<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <link rel="canonical" href="https://blog.csdn.net/weixin_41084236/article/details/81564963"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="renderer" content="webkit"/>
    <meta name="force-rendering" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="report" content='{"pid":"blog"}'>
    <meta name="referrer" content="always">
    <meta http-equiv="Cache-Control" content="no-siteapp" /><link rel="alternate" media="handheld" href="#" />
    <meta name="shenma-site-verification" content="5a59773ab8077d4a62bf469ab966a63b_1497598848">
        <meta name="csdn-baidu-search"  content='{"autorun":true,"install":true,"keyword":"快速入门（完整）：Python实例100个（基于最新Python3.7版本）_Python_Shawn的博客-CSDN博客"}'>
    
    <link href="https://csdnimg.cn/public/favicon.ico" rel="SHORTCUT ICON">
    <title>快速入门（完整）：Python实例100个（基于最新Python3.7版本）_Python_Shawn的博客-CSDN博客</title>
    <meta name="description" content="Python3 100例  原题地址：   http://www.runoob.com/pythonPython">
    <script src='//g.csdnimg.cn/tingyun/1.8.3/blog.js' type='text/javascript'></script>
        
                    <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/detail-075a8c7524.min.css">
                            <script type="application/ld+json">{"@context":"https:\/\/ziyuan.baidu.com\/contexts\/cambrian.jsonld","@id":"https:\/\/blog.csdn.net\/weixin_41084236\/article\/details\/81564963","appid":1638831770136827,"title":"\u5feb\u901f\u5165\u95e8\uff08\u5b8c\u6574\uff09\uff1aPython\u5b9e\u4f8b100\u4e2a\uff08\u57fa\u4e8e\u6700\u65b0Python3.7\u7248\u672c\uff09_Python_Shawn\u7684\u535a\u5ba2-CSDN\u535a\u5ba2","pubDate":"2018-08-10T16:01:27","upDate":"2018-08-10T16:01:27"}</script>
    
            <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/themes/skin3-template/skin3-template-c9d2f651cc.min.css">
    
<!--    自定义皮肤样式-->
    
    <script type="text/javascript">
        var username = "weixin_41084236";
        var blog_address = "https://blog.csdn.net/weixin_41084236";
        var static_host = "https://csdnimg.cn/release/phoenix/";
        var currentUserName = "";
        var isOwner = false;
        var loginUrl = "http://passport.csdn.net/account/login?from=https://blog.csdn.net/weixin_41084236/article/details/81564963"
        var blogUrl = "https://blog.csdn.net/";

        var curSkin = "skin3-template";
        // 收藏所需数据
        var articleTitle = "快速入门（完整）：Python实例100个（基于最新Python3.7版本）";
        var articleDesc = "Python3 100例  原题地址：   http://www.runoob.com/pythonPython";

        var articleTitles = "快速入门（完整）：Python实例100个（基于最新Python3.7版本）_Python_Shawn的博客-CSDN博客";
        
        var nickName = "超级大黄狗Shawn";
        var isCorporate = false;
        var subDomainBlogUrl = "https://blog.csdn.net/"
        var digg_base_url = "https://blog.csdn.net/weixin_41084236";
        var articleDetailUrl = "https://blog.csdn.net/weixin_41084236/article/details/81564963";
        var isShowThird = "0"
    </script>
    <script src="https://csdnimg.cn/public/common/libs/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <!--js引用-->
            <script src="//g.csdnimg.cn/??fixed-sidebar/1.1.6/fixed-sidebar.js,report/1.4.2/report.js" type="text/javascript"></script>
    <link rel="stylesheet" href="https://csdnimg.cn/public/sandalstrap/1.4/css/sandalstrap.min.css">
    <style>
        .MathJax, .MathJax_Message, .MathJax_Preview{
            display: none
        }
    </style>
</head>
<body class="nodata " > 
    <link rel="stylesheet" href="https://csdnimg.cn/public/common/toolbar/content_toolbar_css/content_toolbar.css">
    <script id="toolbar-tpl-scriptId" src="https://csdnimg.cn/public/common/toolbar/js/content_toolbar.js" type="text/javascript" domain="https://blog.csdn.net/"></script>
    <script>
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>
<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/blog_code-c3a0c33d5c.css">
<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/vendor/pagination/paging-e040f0c7c8.css">

<script type="text/javascript">
	var NEWS_FEED = function(){}
</script>

<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/chart-3456820cac.css" />
<div class="main_father clearfix d-flex justify-content-center" style="height:100%;"> 
    <div class="container clearfix" id="mainBox">
        <div  class='space_container'></div>
        <main>
            <div class="blog-content-box">
    <div class="article-header-box">
        <div class="article-header">
            <div class="article-title-box">
                <h1 class="title-article">快速入门（完整）：Python实例100个（基于最新Python3.7版本）</h1>
            </div>
            <div class="article-info-box">
                <div class="article-bar-top">
                    <!--文章类型-->
                    <span class="article-type type-1 float-left">原创</span>                                            <span class="c-gray">置顶</span>
                                                                                                                                            <a class="follow-nickName" href="https://me.csdn.net/weixin_41084236" target="_blank" rel="noopener">超级大黄狗Shawn</a>
                    <span class="time">最后发布于2018-08-10 16:01:27                    </span>
                    <span class="read-count">阅读数 122208</span>
                    <a id='blog_detail_zk_collection' data-report-click='{"mod":"popu_823"}'>
                        <svg class="icon">
                            <use xlink:href="#icon-csdnc-Collection-G" ></use>
                        </svg>
                        收藏
                    </a>
                                    </div>
                                <div class="up-time">发布于2018-08-10 16:01:27</div>
                <div class="slide-content-box">
                                                                                                        <div class="tags-box artic-tag-box">
                                <span class="label">文章标签：</span>
                                                                <a data-report-click='{"mod":"popu_626","strategy":"Python"}' data-report-view='{"mod":"popu_626","strategy":"Python"}' class="tag-link" href="https://so.csdn.net/so/search/s.do?q=Python&t=blog" target="_blank" rel="noopener">Python                                                                    </a>
                            </div>
                                                                                                                <div class="article-copyright">
                        <span class="creativecommons">
                            <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"></a>
                            <span>
                                版权声明：本文为博主原创文章，遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版权协议，转载请附上原文出处链接和本声明。                            </span>
                            <div class="article-source-link2222">
                                本文链接：<a href="https://blog.csdn.net/weixin_41084236/article/details/81564963">https://blog.csdn.net/weixin_41084236/article/details/81564963</a>
                            </div>
                        </span> 
                        </div>
                                                                                </div>
                <div class="operating">
                                                                <a class="href-article-edit slide-toggle">展开</a>
                                    </div>
            </div>
        </div>
    </div>
    <article class="baidu_pl">
        <!--python安装手册开始-->
                <!--python安装手册结束-->
                <!--####专栏广告位图文切换开始-->
                                    <!--####专栏广告位图文切换结束-->
         <div id="article_content" class="article_content clearfix">
            <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-833878f763.css" />
                            <div id="content_views" class="markdown_views prism-atom-one-dark">
                    <!-- flowchart 箭头图标 勿删 -->
                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
                    </svg>
                                            <h1><a id="Python3_100_0"></a>Python3 100例</h1>
<blockquote>
<p>原题地址：<br>
<a href="http://www.runoob.com/python/python-100-examples.html" rel="nofollow">http://www.runoob.com/python/python-100-examples.html</a><br>
git地址：<br>
<a href="https://github.com/RichardFu123/Python100Cases">https://github.com/RichardFu123/Python100Cases</a><br>
转载请标注：<br>
<a href="https://blog.csdn.net/weixin_41084236/article/details/81564963">https://blog.csdn.net/weixin_41084236/article/details/81564963</a><br>
原例为Python2.7版本<br>
重写过程中有不少是随意发挥的<br>
重写运行版本：Python3.7<br>
作者:Shawn</p>
</blockquote>
<ul>
<li>总的来说，并没有什么难度，全部搂了一遍也只花了不到2天时间，其中还有一半以上的时间是用来写文档的。</li>
<li>用来练练手还是凑合的。</li>
</ul>
<p></p><div class="toc"><h3>文章目录</h3><ul><li><a href="#Python3_100_0" rel="nofollow">Python3 100例</a></li><ul><ul><ul><li><a href="#001_18" rel="nofollow">实例001：数字组合</a></li><li><a href="#002_46" rel="nofollow">实例002：“个税计算”</a></li><li><a href="#003_68" rel="nofollow">实例003：完全平方数</a></li><li><a href="#004_98" rel="nofollow">实例004：这天第几天</a></li><li><a href="#005_120" rel="nofollow">实例005：三数排序</a></li><li><a href="#006_147" rel="nofollow">实例006：斐波那契数列</a></li><li><a href="#007copy_169" rel="nofollow">实例007：copy</a></li><li><a href="#008_201" rel="nofollow">实例008：九九乘法表</a></li><li><a href="#009_214" rel="nofollow">实例009：暂停一秒输出</a></li><li><a href="#010_227" rel="nofollow">实例010：给人看的时间</a></li><li><a href="#011_241" rel="nofollow">实例011：养兔子</a></li><li><a href="#012100200_262" rel="nofollow">实例012：100到200的素数</a></li><li><a href="#013_292" rel="nofollow">实例013：所有水仙花数</a></li><li><a href="#014_308" rel="nofollow">实例014：分解质因数</a></li><li><a href="#015_343" rel="nofollow">实例015：分数归档</a></li><li><a href="#016_360" rel="nofollow">实例016：输出日期</a></li><li><a href="#017_376" rel="nofollow">实例017：字符串构成</a></li><li><a href="#018_404" rel="nofollow">实例018：复读机相加</a></li><li><a href="#019_420" rel="nofollow">实例019：完数</a></li><li><a href="#020_441" rel="nofollow">实例020：高空抛物</a></li><li><a href="#021_457" rel="nofollow">实例021：猴子偷桃</a></li><li><a href="#022_470" rel="nofollow">实例022：比赛对手</a></li><li><a href="#023_489" rel="nofollow">实例023：画菱形</a></li><li><a href="#024II_513" rel="nofollow">实例024：斐波那契数列II</a></li><li><a href="#025__530" rel="nofollow">实例025： 阶乘求和</a></li><li><a href="#026_543" rel="nofollow">实例026：递归求阶乘</a></li><li><a href="#027_555" rel="nofollow">实例027：递归输出</a></li><li><a href="#028_570" rel="nofollow">实例028：递归求等差数列</a></li><li><a href="#029_584" rel="nofollow">实例029：反向输出</a></li><li><a href="#030_597" rel="nofollow">实例030：回文数</a></li><li><a href="#031_618" rel="nofollow">实例031：字母识词</a></li><li><a href="#032II_642" rel="nofollow">实例032：反向输出II</a></li><li><a href="#033_653" rel="nofollow">实例033：列表转字符串</a></li><li><a href="#034_664" rel="nofollow">实例034：调用函数</a></li><li><a href="#035_681" rel="nofollow">实例035：设置输出颜色</a></li><li><a href="#036_700" rel="nofollow">实例036：算素数</a></li><li><a href="#037_718" rel="nofollow">实例037：排序</a></li><li><a href="#038_738" rel="nofollow">实例038：矩阵对角线之和</a></li><li><a href="#039_755" rel="nofollow">实例039：有序列表插入元素</a></li><li><a href="#040_773" rel="nofollow">实例040：逆序列表</a></li><li><a href="#041_794" rel="nofollow">实例041：类的方法与变量</a></li><li><a href="#042_818" rel="nofollow">实例042：变量作用域</a></li><li><a href="#043_847" rel="nofollow">实例043：作用域、类的方法与变量</a></li><li><a href="#044_868" rel="nofollow">实例044：矩阵相加</a></li><li><a href="#045_893" rel="nofollow">实例045：求和</a></li><li><a href="#046_906" rel="nofollow">实例046：打破循环</a></li><li><a href="#047_926" rel="nofollow">实例047：函数交换变量</a></li><li><a href="#048_941" rel="nofollow">实例048：数字比大小</a></li><li><a href="#049lambda_958" rel="nofollow">实例049：lambda</a></li><li><a href="#050_975" rel="nofollow">实例050：随机数</a></li><li><a href="#051_986" rel="nofollow">实例051：按位与</a></li><li><a href="#052_1001" rel="nofollow">实例052：按位或</a></li><li><a href="#053_1013" rel="nofollow">实例053：按位异或</a></li><li><a href="#054_1025" rel="nofollow">实例054：位取反、位移动</a></li><li><a href="#055_1048" rel="nofollow">实例055：按位取反</a></li><li><a href="#056_1059" rel="nofollow">实例056：画圈</a></li><li><a href="#057_1078" rel="nofollow">实例057：画线</a></li><li><a href="#058_1113" rel="nofollow">实例058：画矩形</a></li><li><a href="#059_1140" rel="nofollow">实例059：画图（丑）</a></li><li><a href="#060_1180" rel="nofollow">实例060：字符串长度</a></li><li><a href="#061_1191" rel="nofollow">实例061：杨辉三角</a></li><li><a href="#062_1208" rel="nofollow">实例062：查找字符串</a></li><li><a href="#063_1222" rel="nofollow">实例063：画椭圆</a></li><li><a href="#064_1245" rel="nofollow">实例064：画椭圆、矩形</a></li><li><a href="#065_1271" rel="nofollow">实例065：画组合图形</a></li><li><a href="#066_1320" rel="nofollow">实例066：三数排序</a></li><li><a href="#067_1347" rel="nofollow">实例067：交换位置</a></li><li><a href="#068_1366" rel="nofollow">实例068：旋转数列</a></li><li><a href="#069_1381" rel="nofollow">实例069：报数</a></li><li><a href="#070II_1414" rel="nofollow">实例070：字符串长度II</a></li><li><a href="#071_1427" rel="nofollow">实例071：输入和输出</a></li><li><a href="#072_1462" rel="nofollow">实例072：创建链表</a></li><li><a href="#073_1558" rel="nofollow">实例073：反向输出链表</a></li><li><a href="#074_1655" rel="nofollow">实例074：列表排序、连接</a></li><li><a href="#075_1669" rel="nofollow">实例075：不知所云</a></li><li><a href="#076_1686" rel="nofollow">实例076：做函数</a></li><li><a href="#077_1719" rel="nofollow">实例077：遍历列表</a></li><li><a href="#078_1731" rel="nofollow">实例078：字典</a></li><li><a href="#079_1748" rel="nofollow">实例079：字符串排序</a></li><li><a href="#080_1760" rel="nofollow">实例080：猴子分桃</a></li><li><a href="#081_1787" rel="nofollow">实例081：求未知数</a></li><li><a href="#082_1810" rel="nofollow">实例082：八进制转十进制</a></li><li><a href="#083_1821" rel="nofollow">实例083：制作奇数</a></li><li><a href="#084_1849" rel="nofollow">实例084：连接字符串</a></li><li><a href="#085_1861" rel="nofollow">实例085：整除</a></li><li><a href="#086II_1886" rel="nofollow">实例086：连接字符串II</a></li><li><a href="#087_1898" rel="nofollow">实例087：访问类成员</a></li><li><a href="#088_1919" rel="nofollow">实例088：打印星号</a></li><li><a href="#089_1930" rel="nofollow">实例089：解码</a></li><li><a href="#090_1948" rel="nofollow">实例090：列表详解</a></li><li><a href="#091time_1985" rel="nofollow">实例091：time模块</a></li><li><a href="#092timeII_1999" rel="nofollow">实例092：time模块II</a></li><li><a href="#093timeIII_2016" rel="nofollow">实例093：time模块III</a></li><li><a href="#094timeIV_2032" rel="nofollow">实例094：time模块IV</a></li><li><a href="#095_2074" rel="nofollow">实例095：转换时间格式</a></li><li><a href="#096_2086" rel="nofollow">实例096：计算复读次数</a></li><li><a href="#097_2098" rel="nofollow">实例097：磁盘写入</a></li><li><a href="#098II_2117" rel="nofollow">实例098：磁盘写入II</a></li><li><a href="#099_2134" rel="nofollow">实例099：磁盘读写</a></li><li><a href="#100_2160" rel="nofollow">实例100：列表转字典</a></li></ul></ul></ul></ul></div><p></p>
<h4><a id="001_18"></a>实例001：数字组合</h4>
<p><strong>题目</strong> 有四个数字：1、2、3、4，能组成多少个互不相同且无重复数字的三位数？各是多少？</p>
<p><strong>程序分析</strong> 遍历全部可能，把有重复的剃掉。</p>
<pre><code class="prism language-python">total<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">for</span> k <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>i<span class="token operator">!=</span>j<span class="token punctuation">)</span><span class="token operator">and</span><span class="token punctuation">(</span>j<span class="token operator">!=</span>k<span class="token punctuation">)</span><span class="token operator">and</span><span class="token punctuation">(</span>k<span class="token operator">!=</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
                <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>j<span class="token punctuation">,</span>k<span class="token punctuation">)</span>
                total<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>total<span class="token punctuation">)</span>
</code></pre>
<p><strong>简便方法</strong> 用itertools中的permutations即可。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> itertools
sum2<span class="token operator">=</span><span class="token number">0</span>
a<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> itertools<span class="token punctuation">.</span>permutations<span class="token punctuation">(</span>a<span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    sum2<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>sum2<span class="token punctuation">)</span>

</code></pre>
<h4><a id="002_46"></a>实例002：“个税计算”</h4>
<p><strong>题目</strong> 企业发放的奖金根据利润提成。利润(I)低于或等于10万元时，奖金可提10%；利润高于10万元，低于20万元时，低于10万元的部分按10%提成，高于10万元的部分，可提成7.5%；20万到40万之间时，高于20万元的部分，可提成5%；40万到60万之间时高于40万元的部分，可提成3%；60万到100万之间时，高于60万元的部分，可提成1.5%，高于100万元时，超过100万元的部分按1%提成，从键盘输入当月利润I，求应发放奖金总数？</p>
<p><strong>程序分析</strong> 分区间计算即可。</p>
<pre><code class="prism language-python">profit<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'Show me the money: '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
bonus<span class="token operator">=</span><span class="token number">0</span>
thresholds<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">100000</span><span class="token punctuation">,</span><span class="token number">100000</span><span class="token punctuation">,</span><span class="token number">200000</span><span class="token punctuation">,</span><span class="token number">200000</span><span class="token punctuation">,</span><span class="token number">400000</span><span class="token punctuation">]</span>
rates<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">0.1</span><span class="token punctuation">,</span><span class="token number">0.075</span><span class="token punctuation">,</span><span class="token number">0.05</span><span class="token punctuation">,</span><span class="token number">0.03</span><span class="token punctuation">,</span><span class="token number">0.015</span><span class="token punctuation">,</span><span class="token number">0.01</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>thresholds<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> profit<span class="token operator">&lt;=</span>thresholds<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">:</span>
        bonus<span class="token operator">+=</span>profit<span class="token operator">*</span>rates<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
        profit<span class="token operator">=</span><span class="token number">0</span>
        <span class="token keyword">break</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        bonus<span class="token operator">+=</span>thresholds<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">*</span>rates<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
        profit<span class="token operator">-=</span>thresholds<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
bonus<span class="token operator">+=</span>profit<span class="token operator">*</span>rates<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>bonus<span class="token punctuation">)</span>
</code></pre>
<h4><a id="003_68"></a>实例003：完全平方数</h4>
<p><strong>题目</strong> 一个整数，它加上100后是一个完全平方数，再加上168又是一个完全平方数，请问该数是多少？</p>
<p><strong>程序分析</strong> 因为168对于指数爆炸来说实在太小了，所以可以直接省略数学分析，用最朴素的方法来获取上限:</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">while</span> <span class="token punctuation">(</span>n<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">**</span><span class="token number">2</span><span class="token operator">-</span>n<span class="token operator">*</span>n<span class="token operator">&lt;=</span><span class="token number">168</span><span class="token punctuation">:</span>
    n<span class="token operator">+=</span><span class="token number">1</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>n<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span>
<span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span><span class="token operator">-</span>

<span class="token number">85</span>

</code></pre>
<p>思路是：最坏的结果是n的平方与(n+1)的平方刚好差168，由于是平方的关系，不可能存在比这更大的间隙。<br>
至于判断是否是完全平方数，最简单的方法是：平方根的值小数为0即可。<br>
结合起来：</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">while</span> <span class="token punctuation">(</span>n<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">**</span><span class="token number">2</span><span class="token operator">-</span>n<span class="token operator">*</span>n<span class="token operator">&lt;=</span><span class="token number">168</span><span class="token punctuation">:</span>
    n<span class="token operator">+=</span><span class="token number">1</span>

<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token punctuation">(</span>n<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">**</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> i<span class="token operator">**</span><span class="token number">0.5</span><span class="token operator">==</span><span class="token builtin">int</span><span class="token punctuation">(</span>i<span class="token operator">**</span><span class="token number">0.5</span><span class="token punctuation">)</span> <span class="token operator">and</span> <span class="token punctuation">(</span>i<span class="token operator">+</span><span class="token number">168</span><span class="token punctuation">)</span><span class="token operator">**</span><span class="token number">0.5</span><span class="token operator">==</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token punctuation">(</span>i<span class="token operator">+</span><span class="token number">168</span><span class="token punctuation">)</span><span class="token operator">**</span><span class="token number">0.5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token operator">-</span><span class="token number">100</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="004_98"></a>实例004：这天第几天</h4>
<p><strong>题目</strong> 输入某年某月某日，判断这一天是这一年的第几天？</p>
<p><strong>程序分析</strong> 特殊情况，闰年时需考虑二月多加一天：</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">isLeapYear</span><span class="token punctuation">(</span>y<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">return</span> <span class="token punctuation">(</span>y<span class="token operator">%</span><span class="token number">400</span><span class="token operator">==</span><span class="token number">0</span> <span class="token operator">or</span> <span class="token punctuation">(</span>y<span class="token operator">%</span><span class="token number">4</span><span class="token operator">==</span><span class="token number">0</span> <span class="token operator">and</span> y<span class="token operator">%</span><span class="token number">100</span><span class="token operator">!=</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
DofM<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">28</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">,</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">]</span>
res<span class="token operator">=</span><span class="token number">0</span>
year<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'Year:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
month<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'Month:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
day<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'day:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">if</span> isLeapYear<span class="token punctuation">(</span>year<span class="token punctuation">)</span><span class="token punctuation">:</span>
    DofM<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>month<span class="token punctuation">)</span><span class="token punctuation">:</span>
    res<span class="token operator">+=</span>DofM<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>res<span class="token operator">+</span>day<span class="token punctuation">)</span>

</code></pre>
<h4><a id="005_120"></a>实例005：三数排序</h4>
<p><strong>题目</strong> 输入三个整数x,y,z，请把这三个数由小到大输出。</p>
<p><strong>程序分析</strong> 练练手就随便找个排序算法实现一下，偷懒就直接调函数。</p>
<pre><code class="prism language-python">raw<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    x<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'int%d: '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    raw<span class="token punctuation">.</span>append<span class="token punctuation">(</span>x<span class="token punctuation">)</span>
    
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">&gt;</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">:</span>
            raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">=</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span>


raw2<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    x<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'int%d: '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    raw2<span class="token punctuation">.</span>append<span class="token punctuation">(</span>x<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">sorted</span><span class="token punctuation">(</span>raw2<span class="token punctuation">)</span><span class="token punctuation">)</span>

</code></pre>
<h4><a id="006_147"></a>实例006：斐波那契数列</h4>
<p><strong>题目</strong> 斐波那契数列。</p>
<p><strong>程序分析</strong> 斐波那契数列（Fibonacci sequence），从1,1开始，后面每一项等于前面两项之和。图方便就递归实现，图性能就用循环。</p>
<pre><code class="prism language-python"><span class="token comment"># 递归实现</span>
<span class="token keyword">def</span> <span class="token function">Fib</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">return</span> <span class="token number">1</span> <span class="token keyword">if</span> n<span class="token operator">&lt;=</span><span class="token number">2</span> <span class="token keyword">else</span> Fib<span class="token punctuation">(</span>n<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">+</span>Fib<span class="token punctuation">(</span>n<span class="token operator">-</span><span class="token number">2</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>Fib<span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    
<span class="token comment"># 朴素实现</span>
target<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
res<span class="token operator">=</span><span class="token number">0</span>
a<span class="token punctuation">,</span>b<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>target<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    a<span class="token punctuation">,</span>b<span class="token operator">=</span>b<span class="token punctuation">,</span>a<span class="token operator">+</span>b
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>

</code></pre>
<h4><a id="007copy_169"></a>实例007：copy</h4>
<p><strong>题目</strong> 将一个列表的数据复制到另一个列表中。</p>
<p><strong>程序分析</strong> 使用列表[:]，拿不准可以调用copy模块。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> copy
a <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span><span class="token string">'b'</span><span class="token punctuation">]</span><span class="token punctuation">]</span>

b <span class="token operator">=</span> a					<span class="token comment"># 赋值</span>
c <span class="token operator">=</span> a<span class="token punctuation">[</span><span class="token punctuation">:</span><span class="token punctuation">]</span>				<span class="token comment"># 浅拷贝</span>
d <span class="token operator">=</span> copy<span class="token punctuation">.</span>copy<span class="token punctuation">(</span>a<span class="token punctuation">)</span>		<span class="token comment"># 浅拷贝</span>
e <span class="token operator">=</span> copy<span class="token punctuation">.</span>deepcopy<span class="token punctuation">(</span>a<span class="token punctuation">)</span>	<span class="token comment"># 深拷贝</span>

a<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span>
a<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token string">'c'</span><span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a='</span><span class="token punctuation">,</span>a<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'b='</span><span class="token punctuation">,</span>b<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'c='</span><span class="token punctuation">,</span>c<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'d='</span><span class="token punctuation">,</span>d<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'e='</span><span class="token punctuation">,</span>e<span class="token punctuation">)</span>

<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span> RESTART<span class="token punctuation">:</span> F<span class="token punctuation">:</span>\PyWorkspace\Python100\100examples\<span class="token number">007.</span>py <span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span>
a<span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">,</span> <span class="token string">'c'</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">]</span>
b<span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">,</span> <span class="token string">'c'</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">]</span>
c<span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">,</span> <span class="token string">'c'</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
d<span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">,</span> <span class="token string">'c'</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
e<span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
</code></pre>
<h4><a id="008_201"></a>实例008：九九乘法表</h4>
<p><strong>题目</strong> 输出 9*9 乘法口诀表。</p>
<p><strong>程序分析</strong> 分行与列考虑，共9行9列，i控制行，j控制列。</p>
<pre><code class="prism language-python"><span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span>i<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'%d*%d=%2ld '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>j<span class="token punctuation">,</span>i<span class="token operator">*</span>j<span class="token punctuation">)</span><span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="009_214"></a>实例009：暂停一秒输出</h4>
<p><strong>题目</strong> 暂停一秒输出。</p>
<p><strong>程序分析</strong> 使用 time 模块的 sleep() 函数。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> time
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">str</span><span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">2</span><span class="token punctuation">:</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
    time<span class="token punctuation">.</span>sleep<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="010_227"></a>实例010：给人看的时间</h4>
<p><strong>题目</strong> 暂停一秒输出，并格式化当前时间。</p>
<p><strong>程序分析</strong> 同009.</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> time

<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>time<span class="token punctuation">.</span>strftime<span class="token punctuation">(</span><span class="token string">'%Y-%m-%d %H:%M:%S'</span><span class="token punctuation">,</span>time<span class="token punctuation">.</span>localtime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    time<span class="token punctuation">.</span>sleep<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="011_241"></a>实例011：养兔子</h4>
<p><strong>题目</strong> 有一对兔子，从出生后第3个月起每个月都生一对兔子，小兔子长到第三个月后每个月又生一对兔子，假如兔子都不死，问每个月的兔子总数为多少？</p>
<p><strong>程序分析</strong> 我认为原文的解法有点扯，没有考虑3个月成熟的问题，人家还是婴儿怎么生孩子？考虑到三个月成熟，可以构建四个数据，其中：一月兔每个月长大成为二月兔，二月兔变三月兔，三月兔变成年兔，成年兔（包括新成熟的三月兔）生等量的一月兔。</p>
<pre><code class="prism language-python">month<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'繁殖几个月？： '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
month_1<span class="token operator">=</span><span class="token number">1</span>
month_2<span class="token operator">=</span><span class="token number">0</span>
month_3<span class="token operator">=</span><span class="token number">0</span>
month_elder<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>month<span class="token punctuation">)</span><span class="token punctuation">:</span>
    month_1<span class="token punctuation">,</span>month_2<span class="token punctuation">,</span>month_3<span class="token punctuation">,</span>month_elder<span class="token operator">=</span>month_elder<span class="token operator">+</span>month_3<span class="token punctuation">,</span>month_1<span class="token punctuation">,</span>month_2<span class="token punctuation">,</span>month_elder<span class="token operator">+</span>month_3
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'第%d个月共'</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span>month_1<span class="token operator">+</span>month_2<span class="token operator">+</span>month_3<span class="token operator">+</span>month_elder<span class="token punctuation">,</span><span class="token string">'对兔子'</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'其中1月兔：'</span><span class="token punctuation">,</span>month_1<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'其中2月兔：'</span><span class="token punctuation">,</span>month_2<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'其中3月兔：'</span><span class="token punctuation">,</span>month_3<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'其中成年兔：'</span><span class="token punctuation">,</span>month_elder<span class="token punctuation">)</span>
</code></pre>
<h4><a id="012100200_262"></a>实例012：100到200的素数</h4>
<p><strong>题目</strong> 判断101-200之间有多少个素数，并输出所有素数。</p>
<p><strong>程序分析</strong> 判断素数的方法：用一个数分别去除2到sqrt(这个数)，如果能被整除，则表明此数不是素数，反之是素数。 用else可以进一步简化代码.</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> math
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">200</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    flag<span class="token operator">=</span><span class="token number">0</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token builtin">round</span><span class="token punctuation">(</span>math<span class="token punctuation">.</span>sqrt<span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> i<span class="token operator">%</span>j<span class="token operator">==</span><span class="token number">0</span><span class="token punctuation">:</span>
            flag<span class="token operator">=</span><span class="token number">1</span>
            <span class="token keyword">break</span>
    <span class="token keyword">if</span> flag<span class="token punctuation">:</span>
        <span class="token keyword">continue</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>


<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'\nSimplify the code with "else"\n'</span><span class="token punctuation">)</span>


<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">200</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token builtin">round</span><span class="token punctuation">(</span>math<span class="token punctuation">.</span>sqrt<span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> i<span class="token operator">%</span>j<span class="token operator">==</span><span class="token number">0</span><span class="token punctuation">:</span>
            <span class="token keyword">break</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="013_292"></a>实例013：所有水仙花数</h4>
<p><strong>题目</strong> 打印出所有的"水仙花数"，所谓"水仙花数"是指一个三位数，其各位数字立方和等于该数本身。例如：153是一个"水仙花数"，因为153=1的三次方＋5的三次方＋3的三次方。</p>
<p><strong>程序分析</strong> 利用for循环控制100-999个数，每个数分解出个位，十位，百位。</p>
<pre><code class="prism language-python"><span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">1000</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    s<span class="token operator">=</span><span class="token builtin">str</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    one<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span>s<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
    ten<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span>s<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
    hun<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span>s<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> i <span class="token operator">==</span> one<span class="token operator">**</span><span class="token number">3</span><span class="token operator">+</span>ten<span class="token operator">**</span><span class="token number">3</span><span class="token operator">+</span>hun<span class="token operator">**</span><span class="token number">3</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="014_308"></a>实例014：分解质因数</h4>
<p><strong>题目</strong> 将一个整数分解质因数。例如：输入90,打印出90=2<em>3</em>3*5。</p>
<p><strong>程序分析</strong> 根本不需要判断是否是质数，从2开始向数本身遍历，能整除的肯定是最小的质数。</p>
<pre><code class="prism language-python">target<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入一个整数：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>target<span class="token punctuation">,</span><span class="token string">'= '</span><span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>

<span class="token keyword">if</span> target<span class="token operator">&lt;</span><span class="token number">0</span><span class="token punctuation">:</span>
    target<span class="token operator">=</span><span class="token builtin">abs</span><span class="token punctuation">(</span>target<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'-1*'</span><span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>

flag<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">if</span> target<span class="token operator">&lt;=</span><span class="token number">1</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>target<span class="token punctuation">)</span>
    flag<span class="token operator">=</span><span class="token number">1</span>


<span class="token keyword">while</span> <span class="token boolean">True</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> flag<span class="token punctuation">:</span>
        <span class="token keyword">break</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token builtin">int</span><span class="token punctuation">(</span>target<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> target<span class="token operator">%</span>i<span class="token operator">==</span><span class="token number">0</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">"%d"</span><span class="token operator">%</span>i<span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>
            <span class="token keyword">if</span> target<span class="token operator">==</span>i<span class="token punctuation">:</span>
                flag<span class="token operator">=</span><span class="token number">1</span>
                <span class="token keyword">break</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'*'</span><span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>
            target<span class="token operator">/=</span>i
            <span class="token keyword">break</span>
        
</code></pre>
<h4><a id="015_343"></a>实例015：分数归档</h4>
<p><strong>题目</strong> 利用条件运算符的嵌套来完成此题：学习成绩&gt;=90分的同学用A表示，60-89分之间的用B表示，60分以下的用C表示。</p>
<p><strong>程序分析</strong> 用条件判断即可。</p>
<pre><code class="prism language-python">points<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入分数：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">if</span> points<span class="token operator">&gt;=</span><span class="token number">90</span><span class="token punctuation">:</span>
    grade<span class="token operator">=</span><span class="token string">'A'</span>
<span class="token keyword">elif</span> points<span class="token operator">&lt;</span><span class="token number">60</span><span class="token punctuation">:</span>
    grade<span class="token operator">=</span><span class="token string">'C'</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    grade<span class="token operator">=</span><span class="token string">'B'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>grade<span class="token punctuation">)</span>
</code></pre>
<h4><a id="016_360"></a>实例016：输出日期</h4>
<p><strong>题目</strong> 输出指定格式的日期。</p>
<p><strong>程序分析</strong> 使用 datetime 模块。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> datetime
<span class="token keyword">print</span><span class="token punctuation">(</span>datetime<span class="token punctuation">.</span>date<span class="token punctuation">.</span>today<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>datetime<span class="token punctuation">.</span>date<span class="token punctuation">(</span><span class="token number">2333</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>datetime<span class="token punctuation">.</span>date<span class="token punctuation">.</span>today<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>strftime<span class="token punctuation">(</span><span class="token string">'%d/%m/%Y'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
day<span class="token operator">=</span>datetime<span class="token punctuation">.</span>date<span class="token punctuation">(</span><span class="token number">1111</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">)</span>
day<span class="token operator">=</span>day<span class="token punctuation">.</span>replace<span class="token punctuation">(</span>year<span class="token operator">=</span>day<span class="token punctuation">.</span>year<span class="token operator">+</span><span class="token number">22</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>day<span class="token punctuation">)</span>
</code></pre>
<h4><a id="017_376"></a>实例017：字符串构成</h4>
<p><strong>题目</strong> 输入一行字符，分别统计出其中英文字母、空格、数字和其它字符的个数。</p>
<p><strong>程序分析</strong> 利用 while 或 for 语句,条件为输入的字符不为 ‘\n’。</p>
<pre><code class="prism language-python">string<span class="token operator">=</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">"输入字符串："</span><span class="token punctuation">)</span>
alp<span class="token operator">=</span><span class="token number">0</span>
num<span class="token operator">=</span><span class="token number">0</span>
spa<span class="token operator">=</span><span class="token number">0</span>
oth<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>string<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> string<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>isspace<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        spa<span class="token operator">+=</span><span class="token number">1</span>
    <span class="token keyword">elif</span> string<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>isdigit<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        num<span class="token operator">+=</span><span class="token number">1</span>
    <span class="token keyword">elif</span> string<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>isalpha<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        alp<span class="token operator">+=</span><span class="token number">1</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        oth<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'space: '</span><span class="token punctuation">,</span>spa<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'digit: '</span><span class="token punctuation">,</span>num<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'alpha: '</span><span class="token punctuation">,</span>alp<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'other: '</span><span class="token punctuation">,</span>oth<span class="token punctuation">)</span>

</code></pre>
<h4><a id="018_404"></a>实例018：复读机相加</h4>
<p><strong>题目</strong> 求s=a+aa+aaa+aaaa+aa…a的值，其中a是一个数字。例如2+22+222+2222+22222(此时共有5个数相加)，几个数相加由键盘控制。</p>
<p><strong>程序分析</strong> 用字符串解决。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'被加数字：'</span><span class="token punctuation">)</span>
n<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'加几次？：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
res<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    res<span class="token operator">+=</span><span class="token builtin">int</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
    a<span class="token operator">+=</span>a<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'结果是：'</span><span class="token punctuation">,</span>res<span class="token punctuation">)</span>
</code></pre>
<h4><a id="019_420"></a>实例019：完数</h4>
<p><strong>题目</strong> 一个数如果恰好等于它的因子之和，这个数就称为"完数"。例如6=1＋2＋3.编程找出1000以内的所有完数。</p>
<p><strong>程序分析</strong> 将每一对因子加进集合，在这个过程中已经自动去重。最后的结果要求不计算其本身。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">factor</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span><span class="token punctuation">:</span>
    target<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span>
    res<span class="token operator">=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span>num<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> num<span class="token operator">%</span>i<span class="token operator">==</span><span class="token number">0</span><span class="token punctuation">:</span>
            res<span class="token punctuation">.</span>add<span class="token punctuation">(</span>i<span class="token punctuation">)</span>
            res<span class="token punctuation">.</span>add<span class="token punctuation">(</span>num<span class="token operator">/</span>i<span class="token punctuation">)</span>
    <span class="token keyword">return</span> res

<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">1001</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> i<span class="token operator">==</span><span class="token builtin">sum</span><span class="token punctuation">(</span>factor<span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token operator">-</span>i<span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="020_441"></a>实例020：高空抛物</h4>
<p><strong>题目</strong> 一球从100米高度自由落下，每次落地后反跳回原高度的一半；再落下，求它在第10次落地时，共经过多少米？第10次反弹多高？</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python">high<span class="token operator">=</span><span class="token number">200</span><span class="token punctuation">.</span>
total<span class="token operator">=</span><span class="token number">100</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    high<span class="token operator">/=</span><span class="token number">2</span>
    total<span class="token operator">+=</span>high
    <span class="token keyword">print</span><span class="token punctuation">(</span>high<span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'总长：'</span><span class="token punctuation">,</span>total<span class="token punctuation">)</span>
</code></pre>
<h4><a id="021_457"></a>实例021：猴子偷桃</h4>
<p><strong>题目</strong> 猴子吃桃问题：猴子第一天摘下若干个桃子，当即吃了一半，还不瘾，又多吃了一个第二天早上又将剩下的桃子吃掉一半，又多吃了一个。以后每天早上都吃了前一天剩下的一半零一个。到第10天早上想再吃时，见只剩下一个桃子了。求第一天共摘了多少。</p>
<p><strong>程序分析</strong> 按规则反向推断：猴子有一个桃子，他偷来一个桃子，觉得不够又偷来了与手上等量的桃子，一共偷了9天。</p>
<pre><code class="prism language-python">peach<span class="token operator">=</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">9</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    peach<span class="token operator">=</span><span class="token punctuation">(</span>peach<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">*</span><span class="token number">2</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>peach<span class="token punctuation">)</span>
</code></pre>
<h4><a id="022_470"></a>实例022：比赛对手</h4>
<p><strong>题目</strong> 两个乒乓球队进行比赛，各出三人。甲队为a,b,c三人，乙队为x,y,z三人。已抽签决定比赛名单。有人向队员打听比赛的名单。a说他不和x比，c说他不和x,z比，请编程序找出三队赛手的名单。</p>
<p><strong>程序分析</strong> 找到条件下不重复的三个对手即可。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
b<span class="token operator">=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
c<span class="token operator">=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
c<span class="token operator">-=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
a<span class="token operator">-=</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token string">'x'</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> a<span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> b<span class="token punctuation">:</span>
        <span class="token keyword">for</span> k <span class="token keyword">in</span> c<span class="token punctuation">:</span>
            <span class="token keyword">if</span> <span class="token builtin">len</span><span class="token punctuation">(</span><span class="token builtin">set</span><span class="token punctuation">(</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>j<span class="token punctuation">,</span>k<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token operator">==</span><span class="token number">3</span><span class="token punctuation">:</span>
                <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a:%s,b:%s,c:%s'</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>j<span class="token punctuation">,</span>k<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="023_489"></a>实例023：画菱形</h4>
<p><strong>题目</strong> 打印出如下图案（菱形）:</p>
<blockquote>
<p>&nbsp;&nbsp;&nbsp;&nbsp;*<br>
&nbsp;&nbsp;&nbsp;***<br>
&nbsp;&nbsp;*****<br>
&nbsp;*******<br>
&nbsp;&nbsp;*****<br>
&nbsp;&nbsp;&nbsp;***<br>
&nbsp;&nbsp;&nbsp;&nbsp;*</p>
</blockquote>
<p><strong>程序分析</strong> 递归调用即可。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">draw</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span><span class="token punctuation">:</span>
    a<span class="token operator">=</span><span class="token string">"*"</span><span class="token operator">*</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token operator">*</span><span class="token punctuation">(</span><span class="token number">4</span><span class="token operator">-</span>num<span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>center<span class="token punctuation">(</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">' '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> num<span class="token operator">!=</span><span class="token number">1</span><span class="token punctuation">:</span>
        draw<span class="token punctuation">(</span>num<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>center<span class="token punctuation">(</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">' '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
draw<span class="token punctuation">(</span><span class="token number">4</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="024II_513"></a>实例024：斐波那契数列II</h4>
<p><strong>题目</strong> 有一分数序列：2/1，3/2，5/3，8/5，13/8，21/13…求出这个数列的前20项之和。</p>
<p><strong>程序分析</strong> 就是斐波那契数列的后一项除以前一项。</p>
<pre><code class="prism language-python">a <span class="token operator">=</span> <span class="token number">2.0</span>
b <span class="token operator">=</span> <span class="token number">1.0</span>
s <span class="token operator">=</span> <span class="token number">0</span>
<span class="token keyword">for</span> n <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">21</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    s <span class="token operator">+=</span> a <span class="token operator">/</span> b
    a<span class="token punctuation">,</span>b <span class="token operator">=</span> a <span class="token operator">+</span> b<span class="token punctuation">,</span>a
<span class="token keyword">print</span> <span class="token punctuation">(</span>s<span class="token punctuation">)</span>

</code></pre>
<h4><a id="025__530"></a>实例025： 阶乘求和</h4>
<p><strong>题目</strong> 求1+2!+3!+…+20!的和。</p>
<p><strong>程序分析</strong> 1+2!+3!+…+20!=1+2(1+3(1+4(…20(1))))</p>
<pre><code class="prism language-python">res<span class="token operator">=</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    res<span class="token operator">=</span>i<span class="token operator">*</span>res<span class="token operator">+</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span>
</code></pre>
<h4><a id="026_543"></a>实例026：递归求阶乘</h4>
<p><strong>题目</strong> 利用递归方法求5!。</p>
<p><strong>程序分析</strong> 递归调用即可。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">factorial</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">return</span> n<span class="token operator">*</span>factorial<span class="token punctuation">(</span>n<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">if</span> n<span class="token operator">&gt;</span><span class="token number">1</span> <span class="token keyword">else</span> <span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>factorial<span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="027_555"></a>实例027：递归输出</h4>
<p><strong>题目</strong> 利用递归函数调用方式，将所输入的5个字符，以相反顺序打印出来。</p>
<p><strong>程序分析</strong> 递归真是蠢方法。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">rec</span><span class="token punctuation">(</span>string<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> <span class="token builtin">len</span><span class="token punctuation">(</span>string<span class="token punctuation">)</span><span class="token operator">!=</span><span class="token number">1</span><span class="token punctuation">:</span>
        rec<span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">:</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>end<span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">)</span>

rec<span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'string here:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="028_570"></a>实例028：递归求等差数列</h4>
<p><strong>题目</strong> 有5个人坐在一起，问第五个人多少岁？他说比第4个人大2岁。问第4个人岁数，他说比第3个人大2岁。问第三个人，又说比第2人大两岁。问第2个人，说比第一个人大两岁。最后问第一个人，他说是10岁。请问第五个人多大？</p>
<p><strong>程序分析</strong> 就一等差数列。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">age</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> n<span class="token operator">==</span><span class="token number">1</span><span class="token punctuation">:</span>
        <span class="token keyword">return</span> <span class="token number">10</span>
    <span class="token keyword">return</span> <span class="token number">2</span><span class="token operator">+</span>age<span class="token punctuation">(</span>n<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>age<span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="029_584"></a>实例029：反向输出</h4>
<p><strong>题目</strong> 给一个不多于5位的正整数，要求：一、求它是几位数，二、逆序打印出各位数字。</p>
<p><strong>程序分析</strong> 学会分解出每一位数,用字符串的方法总是比较省事。</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入一个正整数：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
n<span class="token operator">=</span><span class="token builtin">str</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'%d位数'</span><span class="token operator">%</span><span class="token builtin">len</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>n<span class="token punctuation">[</span><span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="030_597"></a>实例030：回文数</h4>
<p><strong>题目</strong> 一个5位数，判断它是不是回文数。即12321是回文数，个位与万位相同，十位与千位相同。</p>
<p><strong>程序分析</strong> 用字符串比较方便,就算输入的不是数字都ok。</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">"随便你输入啥啦："</span><span class="token punctuation">)</span>
a<span class="token operator">=</span><span class="token number">0</span>
b<span class="token operator">=</span><span class="token builtin">len</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token operator">-</span><span class="token number">1</span>
flag<span class="token operator">=</span><span class="token boolean">True</span>
<span class="token keyword">while</span> a<span class="token operator">&lt;</span>b<span class="token punctuation">:</span>
    <span class="token keyword">if</span> n<span class="token punctuation">[</span>a<span class="token punctuation">]</span><span class="token operator">!=</span>n<span class="token punctuation">[</span>b<span class="token punctuation">]</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'不是回文串'</span><span class="token punctuation">)</span>
        flag<span class="token operator">=</span><span class="token boolean">False</span>
        <span class="token keyword">break</span>
    a<span class="token punctuation">,</span>b<span class="token operator">=</span>a<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">,</span>b<span class="token operator">-</span><span class="token number">1</span>
<span class="token keyword">if</span> flag<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'是回文串'</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="031_618"></a>实例031：字母识词</h4>
<p><strong>题目</strong> 请输入星期几的第一个字母来判断一下是星期几，如果第一个字母一样，则继续判断第二个字母。</p>
<p><strong>程序分析</strong> 这里用字典的形式直接将对照关系存好。</p>
<pre><code class="prism language-python">weekT<span class="token operator">=</span><span class="token punctuation">{</span><span class="token string">'h'</span><span class="token punctuation">:</span><span class="token string">'thursday'</span><span class="token punctuation">,</span>
       <span class="token string">'u'</span><span class="token punctuation">:</span><span class="token string">'tuesday'</span><span class="token punctuation">}</span>
weekS<span class="token operator">=</span><span class="token punctuation">{</span><span class="token string">'a'</span><span class="token punctuation">:</span><span class="token string">'saturday'</span><span class="token punctuation">,</span>
       <span class="token string">'u'</span><span class="token punctuation">:</span><span class="token string">'sunday'</span><span class="token punctuation">}</span>
week<span class="token operator">=</span><span class="token punctuation">{</span><span class="token string">'t'</span><span class="token punctuation">:</span>weekT<span class="token punctuation">,</span>
      <span class="token string">'s'</span><span class="token punctuation">:</span>weekS<span class="token punctuation">,</span>
      <span class="token string">'m'</span><span class="token punctuation">:</span><span class="token string">'monday'</span><span class="token punctuation">,</span>
      <span class="token string">'w'</span><span class="token punctuation">:</span><span class="token string">'wensday'</span><span class="token punctuation">,</span>
      <span class="token string">'f'</span><span class="token punctuation">:</span><span class="token string">'friday'</span><span class="token punctuation">}</span>
a<span class="token operator">=</span>week<span class="token punctuation">[</span><span class="token builtin">str</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'请输入第一位字母:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>lower<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
<span class="token keyword">if</span> a<span class="token operator">==</span>weekT <span class="token operator">or</span> a<span class="token operator">==</span>weekS<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">[</span><span class="token builtin">str</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'请输入第二位字母:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>lower<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>

</code></pre>
<h4><a id="032II_642"></a>实例032：反向输出II</h4>
<p><strong>题目</strong> 按相反的顺序输出列表的值。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">a <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">'one'</span><span class="token punctuation">,</span> <span class="token string">'two'</span><span class="token punctuation">,</span> <span class="token string">'three'</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">[</span><span class="token punctuation">:</span><span class="token punctuation">:</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="033_653"></a>实例033：列表转字符串</h4>
<p><strong>题目</strong> 按逗号分隔列表。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">L <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">','</span><span class="token punctuation">.</span>join<span class="token punctuation">(</span><span class="token builtin">str</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span> <span class="token keyword">for</span> n <span class="token keyword">in</span> L<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="034_664"></a>实例034：调用函数</h4>
<p><strong>题目</strong> 练习函数调用。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">hello</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'Hello World!'</span><span class="token punctuation">)</span>
<span class="token keyword">def</span> <span class="token function">helloAgain</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        hello<span class="token punctuation">(</span><span class="token punctuation">)</span>

<span class="token keyword">if</span> __name__<span class="token operator">==</span><span class="token string">'__main__'</span><span class="token punctuation">:</span>
    helloAgain<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="035_681"></a>实例035：设置输出颜色</h4>
<p><strong>题目</strong> 文本颜色设置。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">class</span> <span class="token class-name">bcolors</span><span class="token punctuation">:</span>
    HEADER <span class="token operator">=</span> <span class="token string">'\033[95m'</span>
    OKBLUE <span class="token operator">=</span> <span class="token string">'\033[94m'</span>
    OKGREEN <span class="token operator">=</span> <span class="token string">'\033[92m'</span>
    WARNING <span class="token operator">=</span> <span class="token string">'\033[93m'</span>
    FAIL <span class="token operator">=</span> <span class="token string">'\033[91m'</span>
    ENDC <span class="token operator">=</span> <span class="token string">'\033[0m'</span>
    BOLD <span class="token operator">=</span> <span class="token string">'\033[1m'</span>
    UNDERLINE <span class="token operator">=</span> <span class="token string">'\033[4m'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>bcolors<span class="token punctuation">.</span>WARNING <span class="token operator">+</span> <span class="token string">"警告的颜色字体?"</span> <span class="token operator">+</span> bcolors<span class="token punctuation">.</span>ENDC<span class="token punctuation">)</span>
</code></pre>
<h4><a id="036_700"></a>实例036：算素数</h4>
<p><strong>题目</strong> 求100之内的素数。</p>
<p><strong>程序分析</strong> 用else执行for循环的奖励代码（如果for是正常完结，非break）。</p>
<pre><code class="prism language-python">lo<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'下限：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
hi<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'上限：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>lo<span class="token punctuation">,</span>hi<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> i <span class="token operator">&gt;</span> <span class="token number">1</span><span class="token punctuation">:</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span>i<span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>i <span class="token operator">%</span> j<span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">:</span>
                <span class="token keyword">break</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="037_718"></a>实例037：排序</h4>
<p><strong>题目</strong> 对10个数进行排序。</p>
<p><strong>程序分析</strong> 同实例005。</p>
<pre><code class="prism language-python">raw<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    x<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'int%d: '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    raw<span class="token punctuation">.</span>append<span class="token punctuation">(</span>x<span class="token punctuation">)</span>
    
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">&gt;</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">:</span>
            raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">=</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span>

</code></pre>
<h4><a id="038_738"></a>实例038：矩阵对角线之和</h4>
<p><strong>题目</strong> 求一个3*3矩阵主对角线元素之和。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">mat<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
     <span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
     <span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">]</span>
    <span class="token punctuation">]</span>
res<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>mat<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    res<span class="token operator">+=</span>mat<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span>
</code></pre>
<h4><a id="039_755"></a>实例039：有序列表插入元素</h4>
<p><strong>题目</strong> 有一个已经排好序的数组。现输入一个数，要求按原来的规律将它插入数组中。</p>
<p><strong>程序分析</strong> 首先判断此数是否大于最后一个数，然后再考虑插入中间的数的情况，插入后此元素之后的数，依次后移一个位置。</p>
<pre><code class="prism language-python">lis<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">1000</span><span class="token punctuation">,</span><span class="token number">10000</span><span class="token punctuation">,</span><span class="token number">100000</span><span class="token punctuation">]</span>
n<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'insert a number: '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
lis<span class="token punctuation">.</span>append<span class="token punctuation">(</span>n<span class="token punctuation">)</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> lis<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">&gt;=</span>n<span class="token punctuation">:</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span><span class="token builtin">len</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            lis<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">,</span>lis<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token operator">=</span>lis<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>lis<span class="token punctuation">[</span>j<span class="token punctuation">]</span>
        <span class="token keyword">break</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span>
</code></pre>
<h4><a id="040_773"></a>实例040：逆序列表</h4>
<p><strong>题目</strong> 将一个数组逆序输出。</p>
<p><strong>程序分析</strong> 依次交换位置，或者直接调用reverse方法。</p>
<pre><code class="prism language-python">lis<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">1000</span><span class="token punctuation">,</span><span class="token number">10000</span><span class="token punctuation">,</span><span class="token number">100000</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span><span class="token operator">/</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    lis<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span>lis<span class="token punctuation">[</span><span class="token builtin">len</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span><span class="token operator">-</span><span class="token number">1</span><span class="token operator">-</span>i<span class="token punctuation">]</span><span class="token operator">=</span>lis<span class="token punctuation">[</span><span class="token builtin">len</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span><span class="token operator">-</span><span class="token number">1</span><span class="token operator">-</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span>lis<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'第一种实现：'</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span>


lis<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">1000</span><span class="token punctuation">,</span><span class="token number">10000</span><span class="token punctuation">,</span><span class="token number">100000</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'第二种实现：'</span><span class="token punctuation">)</span>
lis<span class="token punctuation">.</span>reverse<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>lis<span class="token punctuation">)</span>

</code></pre>
<h4><a id="041_794"></a>实例041：类的方法与变量</h4>
<p><strong>题目</strong> 模仿静态变量的用法。</p>
<p><strong>程序分析</strong> 构造类，了解类的方法与变量。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">dummy</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    i<span class="token operator">=</span><span class="token number">0</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    i<span class="token operator">+=</span><span class="token number">1</span>

<span class="token keyword">class</span> <span class="token class-name">cls</span><span class="token punctuation">:</span>
    i<span class="token operator">=</span><span class="token number">0</span>
    <span class="token keyword">def</span> <span class="token function">dummy</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>self<span class="token punctuation">.</span>i<span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>i<span class="token operator">+=</span><span class="token number">1</span>

a<span class="token operator">=</span>cls<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">50</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    dummy<span class="token punctuation">(</span><span class="token punctuation">)</span>
    a<span class="token punctuation">.</span>dummy<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="042_818"></a>实例042：变量作用域</h4>
<p><strong>题目</strong> 学习使用auto定义变量的用法。</p>
<p><strong>程序分析</strong> python中的变量作用域。</p>
<pre><code class="prism language-python">i<span class="token operator">=</span><span class="token number">0</span>
n<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">def</span> <span class="token function">dummy</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    i<span class="token operator">=</span><span class="token number">0</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    i<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">def</span> <span class="token function">dummy2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">global</span> n
    <span class="token keyword">print</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
    n<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'函数内部的同名变量'</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    dummy<span class="token punctuation">(</span><span class="token punctuation">)</span>
    i<span class="token operator">+=</span><span class="token number">1</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'global声明同名变量'</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> k <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
    dummy2<span class="token punctuation">(</span><span class="token punctuation">)</span>
    n<span class="token operator">+=</span><span class="token number">10</span>
</code></pre>
<h4><a id="043_847"></a>实例043：作用域、类的方法与变量</h4>
<p><strong>题目</strong> 模仿静态变量(static)另一案例。</p>
<p><strong>程序分析</strong> 综合实例041和实例042。</p>
<pre><code class="prism language-python"><span class="token keyword">class</span> <span class="token class-name">dummy</span><span class="token punctuation">:</span>
    num<span class="token operator">=</span><span class="token number">1</span>
    <span class="token keyword">def</span> <span class="token function">Num</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'class dummy num:'</span><span class="token punctuation">,</span>self<span class="token punctuation">.</span>num<span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'global num: '</span><span class="token punctuation">,</span>num<span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>num<span class="token operator">+=</span><span class="token number">1</span>

n<span class="token operator">=</span>dummy<span class="token punctuation">(</span><span class="token punctuation">)</span>
num<span class="token operator">=</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    num<span class="token operator">*=</span><span class="token number">10</span>
    n<span class="token punctuation">.</span>Num<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="044_868"></a>实例044：矩阵相加</h4>
<p><strong>题目</strong> 计算两个矩阵相加。</p>
<p><strong>程序分析</strong> 创建一个新的矩阵，使用 for 迭代并取出 X 和 Y 矩阵中对应位置的值，相加后放到新矩阵的对应位置中。</p>
<pre><code class="prism language-python">X <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">12</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">4</span> <span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">7</span> <span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
 
Y <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
 
res<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>res<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        res<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">=</span>X<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">+</span>Y<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span>

</code></pre>
<h4><a id="045_893"></a>实例045：求和</h4>
<p><strong>题目</strong> 统计 1 到 100 之和。</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python">res<span class="token operator">=</span><span class="token number">0</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">101</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    res<span class="token operator">+=</span>i
<span class="token keyword">print</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span>
</code></pre>
<h4><a id="046_906"></a>实例046：打破循环</h4>
<p><strong>题目</strong> 求输入数字的平方，如果平方运算后小于 50 则退出。</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python"><span class="token keyword">while</span> <span class="token boolean">True</span><span class="token punctuation">:</span>
    <span class="token keyword">try</span><span class="token punctuation">:</span>
        n<span class="token operator">=</span><span class="token builtin">float</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入一个数字：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">except</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'输入错误'</span><span class="token punctuation">)</span>
        <span class="token keyword">continue</span>
    dn<span class="token operator">=</span>n<span class="token operator">**</span><span class="token number">2</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'其平方为：'</span><span class="token punctuation">,</span>dn<span class="token punctuation">)</span>
    <span class="token keyword">if</span> dn<span class="token operator">&lt;</span><span class="token number">50</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'平方小于50，退出'</span><span class="token punctuation">)</span>
        <span class="token keyword">break</span>
</code></pre>
<h4><a id="047_926"></a>实例047：函数交换变量</h4>
<p><strong>题目</strong> 两个变量值用函数互换。</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">exc</span><span class="token punctuation">(</span>a<span class="token punctuation">,</span>b<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">return</span> <span class="token punctuation">(</span>b<span class="token punctuation">,</span>a<span class="token punctuation">)</span>
a<span class="token operator">=</span><span class="token number">0</span>
b<span class="token operator">=</span><span class="token number">10</span>
a<span class="token punctuation">,</span>b<span class="token operator">=</span>exc<span class="token punctuation">(</span>a<span class="token punctuation">,</span>b<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">,</span>b<span class="token punctuation">)</span>
</code></pre>
<h4><a id="048_941"></a>实例048：数字比大小</h4>
<p><strong>题目</strong> 数字比较。</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'a='</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
b<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'b='</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">if</span> a<span class="token operator">&lt;</span>b<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a&lt;b'</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> a<span class="token operator">&gt;</span>b<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a&gt;b'</span><span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a=b'</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="049lambda_958"></a>实例049：lambda</h4>
<p><strong>题目</strong> 使用lambda来创建匿名函数。</p>
<p><strong>程序分析</strong> 无</p>
<pre><code class="prism language-python">Max<span class="token operator">=</span><span class="token keyword">lambda</span> x<span class="token punctuation">,</span>y<span class="token punctuation">:</span>x<span class="token operator">*</span><span class="token punctuation">(</span>x<span class="token operator">&gt;=</span>y<span class="token punctuation">)</span><span class="token operator">+</span>y<span class="token operator">*</span><span class="token punctuation">(</span>y<span class="token operator">&gt;</span>x<span class="token punctuation">)</span>
Min<span class="token operator">=</span><span class="token keyword">lambda</span> x<span class="token punctuation">,</span>y<span class="token punctuation">:</span>x<span class="token operator">*</span><span class="token punctuation">(</span>x<span class="token operator">&lt;=</span>y<span class="token punctuation">)</span><span class="token operator">+</span>y<span class="token operator">*</span><span class="token punctuation">(</span>y<span class="token operator">&lt;</span>x<span class="token punctuation">)</span>

a<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'1:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
b<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'2:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>Max<span class="token punctuation">(</span>a<span class="token punctuation">,</span>b<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>Min<span class="token punctuation">(</span>a<span class="token punctuation">,</span>b<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="050_975"></a>实例050：随机数</h4>
<p><strong>题目</strong> 输出一个随机数。</p>
<p><strong>程序分析</strong> 使用 random 模块。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> random
<span class="token keyword">print</span><span class="token punctuation">(</span>random<span class="token punctuation">.</span>uniform<span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="051_986"></a>实例051：按位与</h4>
<p><strong>题目</strong> 学习使用按位与 &amp; 。</p>
<p><strong>程序分析</strong> 0&amp;0=0; 0&amp;1=0; 1&amp;0=0; 1&amp;1=1。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token number">0o77</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
b<span class="token operator">=</span>a<span class="token operator">&amp;</span><span class="token number">3</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span>
b<span class="token operator">=</span>b<span class="token operator">&amp;</span><span class="token number">7</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span>
</code></pre>
<h4><a id="052_1001"></a>实例052：按位或</h4>
<p><strong>题目</strong> 学习使用按位或 | 。</p>
<p><strong>程序分析</strong> 0|0=0; 0|1=1; 1|0=1; 1|1=1</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token number">0o77</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token operator">|</span><span class="token number">3</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token operator">|</span><span class="token number">3</span><span class="token operator">|</span><span class="token number">7</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="053_1013"></a>实例053：按位异或</h4>
<p><strong>题目</strong> 学习使用按位异或 ^ 。</p>
<p><strong>程序分析</strong> 0^0=0; 0^1=1; 1^0=1; 1^1=0</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token number">0o77</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token operator">^</span><span class="token number">3</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token operator">^</span><span class="token number">3</span><span class="token operator">^</span><span class="token number">7</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="054_1025"></a>实例054：位取反、位移动</h4>
<p><strong>题目</strong> 取一个整数a从右端开始的4〜7位。</p>
<p><strong>程序分析</strong> 可以这样考虑：<br>
(1)先使a右移4位。<br>
(2)设置一个低4位全为1,其余全为0的数。可用<sub>(</sub>0&lt;&lt;4)<br>
(3)将上面二者进行&amp;运算。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入一个数字: '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
b<span class="token operator">=</span><span class="token number">0</span>                 <span class="token comment">#     0</span>
b<span class="token operator">=</span><span class="token operator">~</span>b                <span class="token comment">#     1</span>
b<span class="token operator">=</span>b<span class="token operator">&lt;&lt;</span><span class="token number">4</span>              <span class="token comment"># 10000</span>
b<span class="token operator">=</span><span class="token operator">~</span>b                <span class="token comment">#  1111</span>
c<span class="token operator">=</span>a<span class="token operator">&gt;&gt;</span><span class="token number">4</span>
d<span class="token operator">=</span>c<span class="token operator">&amp;</span>b
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'a:'</span><span class="token punctuation">,</span><span class="token builtin">bin</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'b:'</span><span class="token punctuation">,</span><span class="token builtin">bin</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'c:'</span><span class="token punctuation">,</span><span class="token builtin">bin</span><span class="token punctuation">(</span>c<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'d:'</span><span class="token punctuation">,</span><span class="token builtin">bin</span><span class="token punctuation">(</span>d<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="055_1048"></a>实例055：按位取反</h4>
<p><strong>题目</strong> 学习使用按位取反~。</p>
<p><strong>程序分析</strong> ~0=1; ~1=0;</p>
<pre><code class="prism language-python"><span class="token keyword">print</span><span class="token punctuation">(</span><span class="token operator">~</span><span class="token number">234</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token operator">~</span><span class="token operator">~</span><span class="token number">234</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="056_1059"></a>实例056：画圈</h4>
<p><strong>题目</strong> 画图，学用circle画圆形。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
canvas<span class="token operator">=</span>Canvas<span class="token punctuation">(</span>width<span class="token operator">=</span><span class="token number">800</span><span class="token punctuation">,</span>height<span class="token operator">=</span><span class="token number">600</span><span class="token punctuation">,</span>bg<span class="token operator">=</span><span class="token string">'yellow'</span><span class="token punctuation">)</span>
canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span>expand<span class="token operator">=</span>YES<span class="token punctuation">,</span>fill<span class="token operator">=</span>BOTH<span class="token punctuation">)</span>
k<span class="token operator">=</span><span class="token number">1</span>
j<span class="token operator">=</span><span class="token number">1</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">26</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span><span class="token number">310</span><span class="token operator">-</span>k<span class="token punctuation">,</span><span class="token number">250</span><span class="token operator">-</span>k<span class="token punctuation">,</span><span class="token number">310</span><span class="token operator">+</span>k<span class="token punctuation">,</span><span class="token number">250</span><span class="token operator">+</span>k<span class="token punctuation">,</span>width<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">)</span>
    k<span class="token operator">+=</span>j
    j<span class="token operator">+=</span><span class="token number">0.3</span>
mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="057_1078"></a>实例057：画线</h4>
<p><strong>题目</strong> 画图，学用line画直线。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
 
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>width<span class="token operator">=</span><span class="token number">300</span><span class="token punctuation">,</span> height<span class="token operator">=</span><span class="token number">300</span><span class="token punctuation">,</span> bg<span class="token operator">=</span><span class="token string">'green'</span><span class="token punctuation">)</span>   
    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span>expand<span class="token operator">=</span>YES<span class="token punctuation">,</span> fill<span class="token operator">=</span>BOTH<span class="token punctuation">)</span>                  
    x0 <span class="token operator">=</span> <span class="token number">263</span>
    y0 <span class="token operator">=</span> <span class="token number">263</span>
    y1 <span class="token operator">=</span> <span class="token number">275</span>
    x1 <span class="token operator">=</span> <span class="token number">275</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">19</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x0<span class="token punctuation">,</span>y1<span class="token punctuation">,</span> width<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span> fill<span class="token operator">=</span><span class="token string">'red'</span><span class="token punctuation">)</span>
        x0 <span class="token operator">=</span> x0 <span class="token operator">-</span> <span class="token number">5</span>
        y0 <span class="token operator">=</span> y0 <span class="token operator">-</span> <span class="token number">5</span>
        x1 <span class="token operator">=</span> x1 <span class="token operator">+</span> <span class="token number">5</span>
        y1 <span class="token operator">=</span> y1 <span class="token operator">+</span> <span class="token number">5</span>
 
    x0 <span class="token operator">=</span> <span class="token number">263</span>
    y1 <span class="token operator">=</span> <span class="token number">275</span>
    y0 <span class="token operator">=</span> <span class="token number">263</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">21</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x0<span class="token punctuation">,</span>y1<span class="token punctuation">,</span>fill <span class="token operator">=</span> <span class="token string">'red'</span><span class="token punctuation">)</span>
        x0 <span class="token operator">+=</span> <span class="token number">5</span>
        y0 <span class="token operator">+=</span> <span class="token number">5</span>
        y1 <span class="token operator">+=</span> <span class="token number">5</span>
 
    mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="058_1113"></a>实例058：画矩形</h4>
<p><strong>题目</strong> 画图，学用rectangle画方形。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
    root <span class="token operator">=</span> Tk<span class="token punctuation">(</span><span class="token punctuation">)</span>
    root<span class="token punctuation">.</span>title<span class="token punctuation">(</span><span class="token string">'Canvas'</span><span class="token punctuation">)</span>
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>root<span class="token punctuation">,</span>width <span class="token operator">=</span> <span class="token number">400</span><span class="token punctuation">,</span>height <span class="token operator">=</span> <span class="token number">400</span><span class="token punctuation">,</span>bg <span class="token operator">=</span> <span class="token string">'yellow'</span><span class="token punctuation">)</span>
    x0 <span class="token operator">=</span> <span class="token number">263</span>
    y0 <span class="token operator">=</span> <span class="token number">263</span>
    y1 <span class="token operator">=</span> <span class="token number">275</span>
    x1 <span class="token operator">=</span> <span class="token number">275</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">19</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        canvas<span class="token punctuation">.</span>create_rectangle<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x1<span class="token punctuation">,</span>y1<span class="token punctuation">)</span>
        x0 <span class="token operator">-=</span> <span class="token number">5</span>
        y0 <span class="token operator">-=</span> <span class="token number">5</span>
        x1 <span class="token operator">+=</span> <span class="token number">5</span>
        y1 <span class="token operator">+=</span> <span class="token number">5</span>
        
    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span><span class="token punctuation">)</span>
    root<span class="token punctuation">.</span>mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="059_1140"></a>实例059：画图（丑）</h4>
<p><strong>题目</strong> 画图，综合例子。</p>
<p><strong>程序分析</strong> 丑。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__  <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>width <span class="token operator">=</span> <span class="token number">300</span><span class="token punctuation">,</span>height <span class="token operator">=</span> <span class="token number">300</span><span class="token punctuation">,</span>bg <span class="token operator">=</span> <span class="token string">'green'</span><span class="token punctuation">)</span>
    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span>expand <span class="token operator">=</span> YES<span class="token punctuation">,</span>fill <span class="token operator">=</span> BOTH<span class="token punctuation">)</span>
    x0 <span class="token operator">=</span> <span class="token number">150</span>
    y0 <span class="token operator">=</span> <span class="token number">100</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span>x0 <span class="token operator">-</span> <span class="token number">10</span><span class="token punctuation">,</span>y0 <span class="token operator">-</span> <span class="token number">10</span><span class="token punctuation">,</span>x0 <span class="token operator">+</span> <span class="token number">10</span><span class="token punctuation">,</span>y0 <span class="token operator">+</span> <span class="token number">10</span><span class="token punctuation">)</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span>x0 <span class="token operator">-</span> <span class="token number">20</span><span class="token punctuation">,</span>y0 <span class="token operator">-</span> <span class="token number">20</span><span class="token punctuation">,</span>x0 <span class="token operator">+</span> <span class="token number">20</span><span class="token punctuation">,</span>y0 <span class="token operator">+</span> <span class="token number">20</span><span class="token punctuation">)</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span>x0 <span class="token operator">-</span> <span class="token number">50</span><span class="token punctuation">,</span>y0 <span class="token operator">-</span> <span class="token number">50</span><span class="token punctuation">,</span>x0 <span class="token operator">+</span> <span class="token number">50</span><span class="token punctuation">,</span>y0 <span class="token operator">+</span> <span class="token number">50</span><span class="token punctuation">)</span>
    <span class="token keyword">import</span> math
    B <span class="token operator">=</span> <span class="token number">0.809</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">16</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        a <span class="token operator">=</span> <span class="token number">2</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">16</span> <span class="token operator">*</span> i
        x <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>x0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">)</span>
        y <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>y0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>a<span class="token punctuation">)</span> <span class="token operator">*</span> B<span class="token punctuation">)</span>
        canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>fill <span class="token operator">=</span> <span class="token string">'red'</span><span class="token punctuation">)</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span>x0 <span class="token operator">-</span> <span class="token number">60</span><span class="token punctuation">,</span>y0 <span class="token operator">-</span> <span class="token number">60</span><span class="token punctuation">,</span>x0 <span class="token operator">+</span> <span class="token number">60</span><span class="token punctuation">,</span>y0 <span class="token operator">+</span> <span class="token number">60</span><span class="token punctuation">)</span>
    

    <span class="token keyword">for</span> k <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">501</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">17</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            a <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token number">2</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">16</span><span class="token punctuation">)</span> <span class="token operator">*</span> i <span class="token operator">+</span> <span class="token punctuation">(</span><span class="token number">2</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">180</span><span class="token punctuation">)</span> <span class="token operator">*</span> k
            x <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>x0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">)</span>
            y <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>y0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">+</span> math<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>a<span class="token punctuation">)</span> <span class="token operator">*</span> B<span class="token punctuation">)</span>
            canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>fill <span class="token operator">=</span> <span class="token string">'red'</span><span class="token punctuation">)</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">51</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            a <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token number">2</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">16</span><span class="token punctuation">)</span> <span class="token operator">*</span> i <span class="token operator">+</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">180</span><span class="token punctuation">)</span> <span class="token operator">*</span> k <span class="token operator">-</span> <span class="token number">1</span>
            x <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>x0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">)</span>
            y <span class="token operator">=</span> math<span class="token punctuation">.</span>ceil<span class="token punctuation">(</span>y0 <span class="token operator">+</span> <span class="token number">48</span> <span class="token operator">*</span> math<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>a<span class="token punctuation">)</span> <span class="token operator">*</span> B<span class="token punctuation">)</span>
            canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>x0<span class="token punctuation">,</span>y0<span class="token punctuation">,</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>fill <span class="token operator">=</span> <span class="token string">'red'</span><span class="token punctuation">)</span>
    mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="060_1180"></a>实例060：字符串长度</h4>
<p><strong>题目</strong> 计算字符串长度。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">s<span class="token operator">=</span><span class="token string">'zhangguang101'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="061_1191"></a>实例061：杨辉三角</h4>
<p><strong>题目</strong> 打印出杨辉三角形前十行。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">generate</span><span class="token punctuation">(</span>numRows<span class="token punctuation">)</span><span class="token punctuation">:</span>
    r <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span>numRows<span class="token punctuation">)</span><span class="token punctuation">:</span>
        r<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token builtin">list</span><span class="token punctuation">(</span><span class="token builtin">map</span><span class="token punctuation">(</span><span class="token keyword">lambda</span> x<span class="token punctuation">,</span>y<span class="token punctuation">:</span>x<span class="token operator">+</span>y<span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">+</span>r<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>r<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token operator">+</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">return</span> r<span class="token punctuation">[</span><span class="token punctuation">:</span>numRows<span class="token punctuation">]</span>
a<span class="token operator">=</span>generate<span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> a<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="062_1208"></a>实例062：查找字符串</h4>
<p><strong>题目</strong> 查找字符串。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">s1<span class="token operator">=</span><span class="token string">'aabbxuebixuebi'</span>
s2<span class="token operator">=</span><span class="token string">'ab'</span>
s3<span class="token operator">=</span><span class="token string">'xue'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">.</span>find<span class="token punctuation">(</span>s2<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">.</span>find<span class="token punctuation">(</span>s3<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="063_1222"></a>实例063：画椭圆</h4>
<p><strong>题目</strong> 画椭圆。</p>
<p><strong>程序分析</strong> 使用 tkinter。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
    x <span class="token operator">=</span> <span class="token number">360</span>
    y <span class="token operator">=</span> <span class="token number">160</span>
    top <span class="token operator">=</span> y <span class="token operator">-</span> <span class="token number">30</span>
    bottom <span class="token operator">=</span> y <span class="token operator">-</span> <span class="token number">30</span>
    
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>width <span class="token operator">=</span> <span class="token number">400</span><span class="token punctuation">,</span>height <span class="token operator">=</span> <span class="token number">600</span><span class="token punctuation">,</span>bg <span class="token operator">=</span> <span class="token string">'white'</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span><span class="token number">250</span> <span class="token operator">-</span> top<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">-</span> bottom<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> top<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> bottom<span class="token punctuation">)</span>
        top <span class="token operator">-=</span> <span class="token number">5</span>
        bottom <span class="token operator">+=</span> <span class="token number">5</span>
    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span><span class="token punctuation">)</span>
    mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="064_1245"></a>实例064：画椭圆、矩形</h4>
<p><strong>题目</strong> 利用ellipse 和 rectangle 画图。。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>width <span class="token operator">=</span> <span class="token number">400</span><span class="token punctuation">,</span>height <span class="token operator">=</span> <span class="token number">600</span><span class="token punctuation">,</span>bg <span class="token operator">=</span> <span class="token string">'white'</span><span class="token punctuation">)</span>
    left <span class="token operator">=</span> <span class="token number">20</span>
    right <span class="token operator">=</span> <span class="token number">50</span>
    top <span class="token operator">=</span> <span class="token number">50</span>
    num <span class="token operator">=</span> <span class="token number">15</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>num<span class="token punctuation">)</span><span class="token punctuation">:</span>
        canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span><span class="token number">250</span> <span class="token operator">-</span> right<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">-</span> left<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> right<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> left<span class="token punctuation">)</span>
        canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span><span class="token number">250</span> <span class="token operator">-</span> <span class="token number">20</span><span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">-</span> top<span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> <span class="token number">20</span><span class="token punctuation">,</span><span class="token number">250</span> <span class="token operator">+</span> top<span class="token punctuation">)</span>
        canvas<span class="token punctuation">.</span>create_rectangle<span class="token punctuation">(</span><span class="token number">20</span> <span class="token operator">-</span> <span class="token number">2</span> <span class="token operator">*</span> i<span class="token punctuation">,</span><span class="token number">20</span> <span class="token operator">-</span> <span class="token number">2</span> <span class="token operator">*</span> i<span class="token punctuation">,</span><span class="token number">10</span> <span class="token operator">*</span> <span class="token punctuation">(</span>i <span class="token operator">+</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token number">10</span> <span class="token operator">*</span> <span class="token punctuation">(</span> i <span class="token operator">+</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        right <span class="token operator">+=</span> <span class="token number">5</span>
        left <span class="token operator">+=</span> <span class="token number">5</span>
        top <span class="token operator">+=</span> <span class="token number">10</span>

    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span><span class="token punctuation">)</span>
    mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="065_1271"></a>实例065：画组合图形</h4>
<p><strong>题目</strong> 一个最优美的图案。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">import</span> math
<span class="token keyword">from</span> tkinter <span class="token keyword">import</span> <span class="token operator">*</span>

<span class="token keyword">class</span> <span class="token class-name">PTS</span><span class="token punctuation">:</span>
    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>x <span class="token operator">=</span> <span class="token number">0</span>
        self<span class="token punctuation">.</span>y <span class="token operator">=</span> <span class="token number">0</span>
points <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>

<span class="token keyword">def</span> <span class="token function">LineToDemo</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    screenx <span class="token operator">=</span> <span class="token number">400</span>
    screeny <span class="token operator">=</span> <span class="token number">400</span>
    canvas <span class="token operator">=</span> Canvas<span class="token punctuation">(</span>width <span class="token operator">=</span> screenx<span class="token punctuation">,</span>height <span class="token operator">=</span> screeny<span class="token punctuation">,</span>bg <span class="token operator">=</span> <span class="token string">'white'</span><span class="token punctuation">)</span>

    AspectRatio <span class="token operator">=</span> <span class="token number">0.85</span>
    MAXPTS <span class="token operator">=</span> <span class="token number">15</span>
    h <span class="token operator">=</span> screeny
    w <span class="token operator">=</span> screenx
    xcenter <span class="token operator">=</span> w <span class="token operator">/</span> <span class="token number">2</span>
    ycenter <span class="token operator">=</span> h <span class="token operator">/</span> <span class="token number">2</span>
    radius <span class="token operator">=</span> <span class="token punctuation">(</span>h <span class="token operator">-</span> <span class="token number">30</span><span class="token punctuation">)</span> <span class="token operator">/</span> <span class="token punctuation">(</span>AspectRatio <span class="token operator">*</span> <span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token number">20</span>
    step <span class="token operator">=</span> <span class="token number">360</span> <span class="token operator">/</span> MAXPTS
    angle <span class="token operator">=</span> <span class="token number">0.0</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>MAXPTS<span class="token punctuation">)</span><span class="token punctuation">:</span>
        rads <span class="token operator">=</span> angle <span class="token operator">*</span> math<span class="token punctuation">.</span>pi <span class="token operator">/</span> <span class="token number">180.0</span>
        p <span class="token operator">=</span> PTS<span class="token punctuation">(</span><span class="token punctuation">)</span>
        p<span class="token punctuation">.</span>x <span class="token operator">=</span> xcenter <span class="token operator">+</span> <span class="token builtin">int</span><span class="token punctuation">(</span>math<span class="token punctuation">.</span>cos<span class="token punctuation">(</span>rads<span class="token punctuation">)</span> <span class="token operator">*</span> radius<span class="token punctuation">)</span>
        p<span class="token punctuation">.</span>y <span class="token operator">=</span> ycenter <span class="token operator">-</span> <span class="token builtin">int</span><span class="token punctuation">(</span>math<span class="token punctuation">.</span>sin<span class="token punctuation">(</span>rads<span class="token punctuation">)</span> <span class="token operator">*</span> radius <span class="token operator">*</span> AspectRatio<span class="token punctuation">)</span>
        angle <span class="token operator">+=</span> step
        points<span class="token punctuation">.</span>append<span class="token punctuation">(</span>p<span class="token punctuation">)</span>
    canvas<span class="token punctuation">.</span>create_oval<span class="token punctuation">(</span>xcenter <span class="token operator">-</span> radius<span class="token punctuation">,</span>ycenter <span class="token operator">-</span> radius<span class="token punctuation">,</span>
                       xcenter <span class="token operator">+</span> radius<span class="token punctuation">,</span>ycenter <span class="token operator">+</span> radius<span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>MAXPTS<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>MAXPTS<span class="token punctuation">)</span><span class="token punctuation">:</span>
            canvas<span class="token punctuation">.</span>create_line<span class="token punctuation">(</span>points<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>x<span class="token punctuation">,</span>points<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>y<span class="token punctuation">,</span>points<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>x<span class="token punctuation">,</span>points<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>y<span class="token punctuation">)</span>

    canvas<span class="token punctuation">.</span>pack<span class="token punctuation">(</span><span class="token punctuation">)</span>
    mainloop<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    LineToDemo<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="066_1320"></a>实例066：三数排序</h4>
<p><strong>题目</strong> 输入3个数a,b,c，按大小顺序输出。</p>
<p><strong>程序分析</strong> 同实例005。</p>
<pre><code class="prism language-python">raw<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    x<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'int%d: '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    raw<span class="token punctuation">.</span>append<span class="token punctuation">(</span>x<span class="token punctuation">)</span>
    
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span><span class="token builtin">len</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token operator">&gt;</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">:</span>
            raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">=</span>raw<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">,</span>raw<span class="token punctuation">[</span>i<span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>raw<span class="token punctuation">)</span>


raw2<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    x<span class="token operator">=</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'int%d: '</span><span class="token operator">%</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    raw2<span class="token punctuation">.</span>append<span class="token punctuation">(</span>x<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">sorted</span><span class="token punctuation">(</span>raw2<span class="token punctuation">)</span><span class="token punctuation">)</span>

</code></pre>
<h4><a id="067_1347"></a>实例067：交换位置</h4>
<p><strong>题目</strong> 输入数组，最大的与第一个元素交换，最小的与最后一个元素交换，输出数组。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">li<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">]</span>

li<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>li<span class="token punctuation">[</span>li<span class="token punctuation">.</span>index<span class="token punctuation">(</span><span class="token builtin">min</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token operator">=</span>li<span class="token punctuation">[</span>li<span class="token punctuation">.</span>index<span class="token punctuation">(</span><span class="token builtin">min</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">,</span>li<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span>

m<span class="token operator">=</span>li<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
ind<span class="token operator">=</span>li<span class="token punctuation">.</span>index<span class="token punctuation">(</span><span class="token builtin">max</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span><span class="token punctuation">)</span>
li<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">=</span>li<span class="token punctuation">[</span>ind<span class="token punctuation">]</span>
li<span class="token punctuation">[</span>ind<span class="token punctuation">]</span><span class="token operator">=</span>m

<span class="token keyword">print</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span>
</code></pre>
<h4><a id="068_1366"></a>实例068：旋转数列</h4>
<p><strong>题目</strong> 有n个整数，使其前面各数顺序向后移m个位置，最后m个数变成最前面的m个数</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">from</span> collections <span class="token keyword">import</span> <span class="token operator">*</span>
li<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">]</span>
deq<span class="token operator">=</span>deque<span class="token punctuation">(</span>li<span class="token punctuation">,</span>maxlen<span class="token operator">=</span><span class="token builtin">len</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>li<span class="token punctuation">)</span>
deq<span class="token punctuation">.</span>rotate<span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'rotate:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">list</span><span class="token punctuation">(</span>deq<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="069_1381"></a>实例069：报数</h4>
<p><strong>题目</strong> 有n个人围成一圈，顺序排号。从第一个人开始报数（从1到3报数），凡报到3的人退出圈子，问最后留下的是原来第几号的那位。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    nmax <span class="token operator">=</span> <span class="token number">50</span>
    n <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'请输入总人数:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    num <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
        num<span class="token punctuation">.</span>append<span class="token punctuation">(</span>i <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">)</span>
 
    i <span class="token operator">=</span> <span class="token number">0</span>
    k <span class="token operator">=</span> <span class="token number">0</span>
    m <span class="token operator">=</span> <span class="token number">0</span>
 
    <span class="token keyword">while</span> m <span class="token operator">&lt;</span> n <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> num<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">!=</span> <span class="token number">0</span> <span class="token punctuation">:</span> k <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> k <span class="token operator">==</span> <span class="token number">3</span><span class="token punctuation">:</span>
            num<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span>
            k <span class="token operator">=</span> <span class="token number">0</span>
            m <span class="token operator">+=</span> <span class="token number">1</span>
        i <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> i <span class="token operator">==</span> n <span class="token punctuation">:</span> i <span class="token operator">=</span> <span class="token number">0</span>
 
    i <span class="token operator">=</span> <span class="token number">0</span>
    <span class="token keyword">while</span> num<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">:</span> i <span class="token operator">+=</span> <span class="token number">1</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>num<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="070II_1414"></a>实例070：字符串长度II</h4>
<p><strong>题目</strong> 写一个函数，求一个字符串的长度，在main函数中输入字符串，并输出其长度。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">lenofstr</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">return</span> <span class="token builtin">len</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span>

<span class="token keyword">print</span><span class="token punctuation">(</span>lenofstr<span class="token punctuation">(</span><span class="token string">'tanxiaofengsheng'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="071_1427"></a>实例071：输入和输出</h4>
<p><strong>题目</strong> 编写input()和output()函数输入，输出5个学生的数据记录。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">N <span class="token operator">=</span> <span class="token number">3</span>
<span class="token comment">#stu</span>
<span class="token comment"># num : string</span>
<span class="token comment"># name : string</span>
<span class="token comment"># score[4]: list</span>
student <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    student<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">''</span><span class="token punctuation">,</span><span class="token string">''</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
 
<span class="token keyword">def</span> <span class="token function">input_stu</span><span class="token punctuation">(</span>stu<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>N<span class="token punctuation">)</span><span class="token punctuation">:</span>
        stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input student num:\n'</span><span class="token punctuation">)</span>
        stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input student name:\n'</span><span class="token punctuation">)</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'score:\n'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
 
<span class="token keyword">def</span> <span class="token function">output_stu</span><span class="token punctuation">(</span>stu<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>N<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'%-6s%-10s'</span> <span class="token operator">%</span> <span class="token punctuation">(</span> stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'%-8d'</span> <span class="token operator">%</span> stu<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">)</span>
 
<span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    input_stu<span class="token punctuation">(</span>student<span class="token punctuation">)</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span>student<span class="token punctuation">)</span>
    output_stu<span class="token punctuation">(</span>student<span class="token punctuation">)</span>
</code></pre>
<h4><a id="072_1462"></a>实例072：创建链表</h4>
<p><strong>题目</strong> 创建一个链表。</p>
<p><strong>程序分析</strong> 原文不太靠谱。</p>
<pre><code class="prism language-python"><span class="token keyword">class</span> <span class="token class-name">Node</span><span class="token punctuation">:</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> data<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>data <span class="token operator">=</span> data
        self<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> <span class="token boolean">None</span>

    <span class="token keyword">def</span> <span class="token function">get_data</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>data

<span class="token keyword">class</span> <span class="token class-name">List</span><span class="token punctuation">:</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>head <span class="token operator">=</span> head

    <span class="token keyword">def</span> <span class="token function">is_empty</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span> 
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span>

    <span class="token keyword">def</span> <span class="token function">get_len</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>  
        length <span class="token operator">=</span> <span class="token number">0</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            length <span class="token operator">+=</span> <span class="token number">1</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">return</span> length

    <span class="token keyword">def</span> <span class="token function">append</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> node<span class="token punctuation">)</span><span class="token punctuation">:</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        <span class="token keyword">while</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
        temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> node

    <span class="token keyword">def</span> <span class="token function">delete</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> index<span class="token punctuation">)</span><span class="token punctuation">:</span> 
        <span class="token keyword">if</span> index <span class="token operator">&lt;</span> <span class="token number">1</span> <span class="token operator">or</span> index <span class="token operator">&gt;</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">"给定位置不合理"</span><span class="token punctuation">)</span>
            <span class="token keyword">return</span>
        <span class="token keyword">if</span> index <span class="token operator">==</span> <span class="token number">1</span><span class="token punctuation">:</span>
            self<span class="token punctuation">.</span>head <span class="token operator">=</span> self<span class="token punctuation">.</span>head<span class="token punctuation">.</span><span class="token builtin">next</span>
            <span class="token keyword">return</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        cur_pos <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            cur_pos <span class="token operator">+=</span> <span class="token number">1</span>
            <span class="token keyword">if</span> cur_pos <span class="token operator">==</span> index<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">:</span>
                temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span><span class="token punctuation">.</span><span class="token builtin">next</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>

    <span class="token keyword">def</span> <span class="token function">insert</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> pos<span class="token punctuation">,</span> node<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> pos <span class="token operator">&lt;</span> <span class="token number">1</span> <span class="token operator">or</span> pos <span class="token operator">&gt;</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">"插入结点位置不合理"</span><span class="token punctuation">)</span>
            <span class="token keyword">return</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        cur_pos <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> Node<span class="token punctuation">:</span>
            cur_pos <span class="token operator">+=</span> <span class="token number">1</span>
            <span class="token keyword">if</span> cur_pos <span class="token operator">==</span> pos<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">:</span>
                node<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
                temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span>node
                <span class="token keyword">break</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>

    <span class="token keyword">def</span> <span class="token function">reverse</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> head <span class="token keyword">is</span> <span class="token boolean">None</span> <span class="token operator">and</span> head<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token keyword">is</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            <span class="token keyword">return</span> head
        pre <span class="token operator">=</span> head
        cur <span class="token operator">=</span> head<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">while</span> cur <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            temp <span class="token operator">=</span> cur<span class="token punctuation">.</span><span class="token builtin">next</span>
            cur<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> pre
            pre <span class="token operator">=</span> cur
            cur <span class="token operator">=</span> temp
        head<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> <span class="token boolean">None</span>
        <span class="token keyword">return</span> pre

    <span class="token keyword">def</span> <span class="token function">print_list</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        init_data <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
        <span class="token keyword">while</span> head <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            init_data<span class="token punctuation">.</span>append<span class="token punctuation">(</span>head<span class="token punctuation">.</span>get_data<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
            head <span class="token operator">=</span> head<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">return</span> init_data

<span class="token keyword">if</span> __name__<span class="token operator">==</span><span class="token string">'__main__'</span><span class="token punctuation">:</span>
    head<span class="token operator">=</span>Node<span class="token punctuation">(</span><span class="token string">'head'</span><span class="token punctuation">)</span>
    link<span class="token operator">=</span>List<span class="token punctuation">(</span>head<span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        node<span class="token operator">=</span>Node<span class="token punctuation">(</span>i<span class="token punctuation">)</span>
        link<span class="token punctuation">.</span>append<span class="token punctuation">(</span>node<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>link<span class="token punctuation">.</span>print_list<span class="token punctuation">(</span>head<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="073_1558"></a>实例073：反向输出链表</h4>
<p><strong>题目</strong> 反向输出一个链表。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">class</span> <span class="token class-name">Node</span><span class="token punctuation">:</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> data<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>data <span class="token operator">=</span> data
        self<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> <span class="token boolean">None</span>

    <span class="token keyword">def</span> <span class="token function">get_data</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>data

<span class="token keyword">class</span> <span class="token class-name">List</span><span class="token punctuation">:</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>head <span class="token operator">=</span> head

    <span class="token keyword">def</span> <span class="token function">is_empty</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span> 
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span>

    <span class="token keyword">def</span> <span class="token function">get_len</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>  
        length <span class="token operator">=</span> <span class="token number">0</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            length <span class="token operator">+=</span> <span class="token number">1</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">return</span> length

    <span class="token keyword">def</span> <span class="token function">append</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> node<span class="token punctuation">)</span><span class="token punctuation">:</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        <span class="token keyword">while</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
        temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> node

    <span class="token keyword">def</span> <span class="token function">delete</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> index<span class="token punctuation">)</span><span class="token punctuation">:</span> 
        <span class="token keyword">if</span> index <span class="token operator">&lt;</span> <span class="token number">1</span> <span class="token operator">or</span> index <span class="token operator">&gt;</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">"给定位置不合理"</span><span class="token punctuation">)</span>
            <span class="token keyword">return</span>
        <span class="token keyword">if</span> index <span class="token operator">==</span> <span class="token number">1</span><span class="token punctuation">:</span>
            self<span class="token punctuation">.</span>head <span class="token operator">=</span> self<span class="token punctuation">.</span>head<span class="token punctuation">.</span><span class="token builtin">next</span>
            <span class="token keyword">return</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        cur_pos <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            cur_pos <span class="token operator">+=</span> <span class="token number">1</span>
            <span class="token keyword">if</span> cur_pos <span class="token operator">==</span> index<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">:</span>
                temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span><span class="token punctuation">.</span><span class="token builtin">next</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>

    <span class="token keyword">def</span> <span class="token function">insert</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> pos<span class="token punctuation">,</span> node<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> pos <span class="token operator">&lt;</span> <span class="token number">1</span> <span class="token operator">or</span> pos <span class="token operator">&gt;</span> self<span class="token punctuation">.</span>get_len<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">"插入结点位置不合理"</span><span class="token punctuation">)</span>
            <span class="token keyword">return</span>
        temp <span class="token operator">=</span> self<span class="token punctuation">.</span>head
        cur_pos <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">while</span> temp <span class="token keyword">is</span> <span class="token operator">not</span> Node<span class="token punctuation">:</span>
            cur_pos <span class="token operator">+=</span> <span class="token number">1</span>
            <span class="token keyword">if</span> cur_pos <span class="token operator">==</span> pos<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">:</span>
                node<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>
                temp<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span>node
                <span class="token keyword">break</span>
            temp <span class="token operator">=</span> temp<span class="token punctuation">.</span><span class="token builtin">next</span>

    <span class="token keyword">def</span> <span class="token function">reverse</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> head <span class="token keyword">is</span> <span class="token boolean">None</span> <span class="token operator">and</span> head<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token keyword">is</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            <span class="token keyword">return</span> head
        pre <span class="token operator">=</span> head
        cur <span class="token operator">=</span> head<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">while</span> cur <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            temp <span class="token operator">=</span> cur<span class="token punctuation">.</span><span class="token builtin">next</span>
            cur<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> pre
            pre <span class="token operator">=</span> cur
            cur <span class="token operator">=</span> temp
        head<span class="token punctuation">.</span><span class="token builtin">next</span> <span class="token operator">=</span> <span class="token boolean">None</span>
        <span class="token keyword">return</span> pre

    <span class="token keyword">def</span> <span class="token function">print_list</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> head<span class="token punctuation">)</span><span class="token punctuation">:</span>
        init_data <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
        <span class="token keyword">while</span> head <span class="token keyword">is</span> <span class="token operator">not</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            init_data<span class="token punctuation">.</span>append<span class="token punctuation">(</span>head<span class="token punctuation">.</span>get_data<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
            head <span class="token operator">=</span> head<span class="token punctuation">.</span><span class="token builtin">next</span>
        <span class="token keyword">return</span> init_data

<span class="token keyword">if</span> __name__<span class="token operator">==</span><span class="token string">'__main__'</span><span class="token punctuation">:</span>
    head<span class="token operator">=</span>Node<span class="token punctuation">(</span><span class="token string">'head'</span><span class="token punctuation">)</span>
    link<span class="token operator">=</span>List<span class="token punctuation">(</span>head<span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        node<span class="token operator">=</span>Node<span class="token punctuation">(</span>i<span class="token punctuation">)</span>
        link<span class="token punctuation">.</span>append<span class="token punctuation">(</span>node<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>link<span class="token punctuation">.</span>print_list<span class="token punctuation">(</span>head<span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>link<span class="token punctuation">.</span>print_list<span class="token punctuation">(</span>link<span class="token punctuation">.</span>reverse<span class="token punctuation">(</span>head<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="074_1655"></a>实例074：列表排序、连接</h4>
<p><strong>题目</strong> 列表排序及连接。</p>
<p><strong>程序分析</strong> 排序可使用 sort() 方法，连接可以使用 + 号或 extend() 方法。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">]</span>
b<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">]</span>
a<span class="token punctuation">.</span>extend<span class="token punctuation">(</span>b<span class="token punctuation">)</span>
a<span class="token punctuation">.</span>sort<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
</code></pre>
<h4><a id="075_1669"></a>实例075：不知所云</h4>
<p><strong>题目</strong> 放松一下，算一道简单的题目。</p>
<p><strong>程序分析</strong> 鬼知道是什么。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        n <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">if</span> i <span class="token operator">!=</span> <span class="token number">1</span><span class="token punctuation">:</span> n <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> i <span class="token operator">==</span> <span class="token number">3</span><span class="token punctuation">:</span> n <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> i <span class="token operator">==</span> <span class="token number">4</span><span class="token punctuation">:</span> n <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> i <span class="token operator">!=</span> <span class="token number">4</span><span class="token punctuation">:</span> n <span class="token operator">+=</span> <span class="token number">1</span>
        <span class="token keyword">if</span> n <span class="token operator">==</span> <span class="token number">3</span><span class="token punctuation">:</span> <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token number">64</span> <span class="token operator">+</span> i<span class="token punctuation">)</span>
</code></pre>
<h4><a id="076_1686"></a>实例076：做函数</h4>
<p><strong>题目</strong> 编写一个函数，输入n为偶数时，调用函数求1/2+1/4+…+1/n,当输入n为奇数时，调用函数1/1+1/3+…+1/n</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">def</span> <span class="token function">peven</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    i <span class="token operator">=</span> <span class="token number">0</span>
    s <span class="token operator">=</span> <span class="token number">0.0</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span>n <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        s <span class="token operator">+=</span> <span class="token number">1.0</span> <span class="token operator">/</span> i
    <span class="token keyword">return</span> s
 
<span class="token keyword">def</span> <span class="token function">podd</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    s <span class="token operator">=</span> <span class="token number">0.0</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> n <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        s <span class="token operator">+=</span> <span class="token number">1.0</span> <span class="token operator">/</span> i
    <span class="token keyword">return</span> s
 
<span class="token keyword">def</span> <span class="token function">dcall</span><span class="token punctuation">(</span>fp<span class="token punctuation">,</span>n<span class="token punctuation">)</span><span class="token punctuation">:</span>
    s <span class="token operator">=</span> fp<span class="token punctuation">(</span>n<span class="token punctuation">)</span>
    <span class="token keyword">return</span> s
 
<span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    n <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input a number: '</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> n <span class="token operator">%</span> <span class="token number">2</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">:</span>
        <span class="token builtin">sum</span> <span class="token operator">=</span> dcall<span class="token punctuation">(</span>peven<span class="token punctuation">,</span>n<span class="token punctuation">)</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        <span class="token builtin">sum</span> <span class="token operator">=</span> dcall<span class="token punctuation">(</span>podd<span class="token punctuation">,</span>n<span class="token punctuation">)</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">sum</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="077_1719"></a>实例077：遍历列表</h4>
<p><strong>题目</strong> 循环输出列表</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">l<span class="token operator">=</span><span class="token punctuation">[</span><span class="token string">'moyu'</span><span class="token punctuation">,</span><span class="token string">'niupi'</span><span class="token punctuation">,</span><span class="token string">'xuecaibichi'</span><span class="token punctuation">,</span><span class="token string">'shengfaji'</span><span class="token punctuation">,</span><span class="token string">'42'</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>l<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>l<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="078_1731"></a>实例078：字典</h4>
<p><strong>题目</strong> 找到年龄最大的人，并输出。请找出程序中有什么问题。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    person <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token string">"li"</span><span class="token punctuation">:</span><span class="token number">18</span><span class="token punctuation">,</span><span class="token string">"wang"</span><span class="token punctuation">:</span><span class="token number">50</span><span class="token punctuation">,</span><span class="token string">"zhang"</span><span class="token punctuation">:</span><span class="token number">20</span><span class="token punctuation">,</span><span class="token string">"sun"</span><span class="token punctuation">:</span><span class="token number">22</span><span class="token punctuation">}</span>
    m <span class="token operator">=</span> <span class="token string">'li'</span>
    <span class="token keyword">for</span> key <span class="token keyword">in</span> person<span class="token punctuation">.</span>keys<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> person<span class="token punctuation">[</span>m<span class="token punctuation">]</span> <span class="token operator">&lt;</span> person<span class="token punctuation">[</span>key<span class="token punctuation">]</span><span class="token punctuation">:</span>
            m <span class="token operator">=</span> key
 
    <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'%s,%d'</span> <span class="token operator">%</span> <span class="token punctuation">(</span>m<span class="token punctuation">,</span>person<span class="token punctuation">[</span>m<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="079_1748"></a>实例079：字符串排序</h4>
<p><strong>题目</strong> 字符串排序。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">l<span class="token operator">=</span><span class="token punctuation">[</span><span class="token string">'baaa'</span><span class="token punctuation">,</span><span class="token string">'aaab'</span><span class="token punctuation">,</span><span class="token string">'aaba'</span><span class="token punctuation">,</span><span class="token string">'aaaa'</span><span class="token punctuation">,</span><span class="token string">'abaa'</span><span class="token punctuation">]</span>
l<span class="token punctuation">.</span>sort<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>l<span class="token punctuation">)</span>
</code></pre>
<h4><a id="080_1760"></a>实例080：猴子分桃</h4>
<p><strong>题目</strong> 海滩上有一堆桃子，五只猴子来分。第一只猴子把这堆桃子平均分为五份，多了一个，这只猴子把多的一个扔入海中，拿走了一份。第二只猴子把剩下的桃子又平均分成五份，又多了一个，它同样把多的一个扔入海中，拿走了一份，第三、第四、第五只猴子都是这样做的，问海滩上原来最少有多少个桃子？</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    i <span class="token operator">=</span> <span class="token number">0</span>
    j <span class="token operator">=</span> <span class="token number">1</span>
    x <span class="token operator">=</span> <span class="token number">0</span>
    <span class="token keyword">while</span> <span class="token punctuation">(</span>i <span class="token operator">&lt;</span> <span class="token number">5</span><span class="token punctuation">)</span> <span class="token punctuation">:</span>
        x <span class="token operator">=</span> <span class="token number">4</span> <span class="token operator">*</span> j
        <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">)</span> <span class="token punctuation">:</span>
            <span class="token keyword">if</span><span class="token punctuation">(</span>x<span class="token operator">%</span><span class="token number">4</span> <span class="token operator">!=</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">:</span>
                <span class="token keyword">break</span>
            <span class="token keyword">else</span> <span class="token punctuation">:</span>
                i <span class="token operator">+=</span> <span class="token number">1</span>
            x <span class="token operator">=</span> <span class="token punctuation">(</span>x<span class="token operator">/</span><span class="token number">4</span><span class="token punctuation">)</span> <span class="token operator">*</span> <span class="token number">5</span> <span class="token operator">+</span><span class="token number">1</span>
        j <span class="token operator">+=</span> <span class="token number">1</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>x<span class="token punctuation">)</span>

    <span class="token keyword">for</span> p <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        x<span class="token operator">=</span><span class="token punctuation">(</span>x<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token operator">/</span><span class="token number">5</span><span class="token operator">*</span><span class="token number">4</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>x<span class="token punctuation">)</span>
</code></pre>
<h4><a id="081_1787"></a>实例081：求未知数</h4>
<p><strong>题目</strong> 809*??=800*??+9*?? 其中??代表的两位数, 809*??为四位数，8*??的结果为两位数，9*??的结果为3位数。求??代表的两位数，及809*??后的结果。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">a <span class="token operator">=</span> <span class="token number">809</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    b <span class="token operator">=</span> i <span class="token operator">*</span> a
    <span class="token keyword">if</span> b <span class="token operator">&gt;=</span> <span class="token number">1000</span> <span class="token operator">and</span> b <span class="token operator">&lt;=</span> <span class="token number">10000</span> <span class="token operator">and</span> <span class="token number">8</span> <span class="token operator">*</span> i <span class="token operator">&lt;</span> <span class="token number">100</span> <span class="token operator">and</span> <span class="token number">9</span> <span class="token operator">*</span> i <span class="token operator">&gt;=</span> <span class="token number">100</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>b<span class="token punctuation">,</span><span class="token string">' = 800 * '</span><span class="token punctuation">,</span> i<span class="token punctuation">,</span> <span class="token string">' + 9 * '</span><span class="token punctuation">,</span> i<span class="token punctuation">)</span>


<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> <span class="token number">8</span><span class="token operator">*</span>i<span class="token operator">&gt;</span><span class="token number">99</span> <span class="token operator">or</span> <span class="token number">9</span><span class="token operator">*</span>i<span class="token operator">&lt;</span><span class="token number">100</span><span class="token punctuation">:</span>
        <span class="token keyword">continue</span>
    <span class="token keyword">if</span> <span class="token number">809</span><span class="token operator">*</span>i<span class="token operator">==</span><span class="token number">800</span><span class="token operator">*</span>i<span class="token operator">+</span><span class="token number">9</span><span class="token operator">*</span>i<span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
        <span class="token keyword">break</span>
</code></pre>
<h4><a id="082_1810"></a>实例082：八进制转十进制</h4>
<p><strong>题目</strong> 八进制转换为十进制</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token builtin">eval</span><span class="token punctuation">(</span><span class="token string">'0o'</span><span class="token operator">+</span><span class="token builtin">str</span><span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'八进制输入：'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
</code></pre>
<h4><a id="083_1821"></a>实例083：制作奇数</h4>
<p><strong>题目</strong> 求0—7所能组成的奇数个数。</p>
<p><strong>程序分析</strong></p>
<p>组成1位数是4个。1,3,5,7结尾</p>
<p>组成2位数是7*4个。第一位不能为0</p>
<p>组成3位数是7*8*4个。中间随意</p>
<p>组成4位数是7*8*8*4个。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token builtin">sum</span> <span class="token operator">=</span> <span class="token number">4</span>
    s <span class="token operator">=</span> <span class="token number">4</span>
    <span class="token keyword">for</span> j <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">sum</span><span class="token punctuation">)</span>
        <span class="token keyword">if</span> j <span class="token operator">&lt;=</span> <span class="token number">2</span><span class="token punctuation">:</span>
            s <span class="token operator">*=</span> <span class="token number">7</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            s <span class="token operator">*=</span> <span class="token number">8</span>
        <span class="token builtin">sum</span> <span class="token operator">+=</span> s
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'sum = %d'</span> <span class="token operator">%</span> <span class="token builtin">sum</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="084_1849"></a>实例084：连接字符串</h4>
<p><strong>题目</strong> 连接字符串。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">delimiter <span class="token operator">=</span> <span class="token string">','</span>
mylist <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">'Brazil'</span><span class="token punctuation">,</span> <span class="token string">'Russia'</span><span class="token punctuation">,</span> <span class="token string">'India'</span><span class="token punctuation">,</span> <span class="token string">'China'</span><span class="token punctuation">]</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>delimiter<span class="token punctuation">.</span>join<span class="token punctuation">(</span>mylist<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="085_1861"></a>实例085：整除</h4>
<p><strong>题目</strong> 输入一个奇数，然后判断最少几个 9 除于该数的结果为整数。</p>
<p><strong>程序分析</strong> 999999 / 13 = 76923。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    zi <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入一个数字:'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    n1 <span class="token operator">=</span> <span class="token number">1</span>
    c9 <span class="token operator">=</span> <span class="token number">1</span>
    m9 <span class="token operator">=</span> <span class="token number">9</span>
    <span class="token builtin">sum</span> <span class="token operator">=</span> <span class="token number">9</span>
    <span class="token keyword">while</span> n1 <span class="token operator">!=</span> <span class="token number">0</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> <span class="token builtin">sum</span> <span class="token operator">%</span> zi <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">:</span>
            n1 <span class="token operator">=</span> <span class="token number">0</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            m9 <span class="token operator">*=</span> <span class="token number">10</span>
            <span class="token builtin">sum</span> <span class="token operator">+=</span> m9
            c9 <span class="token operator">+=</span> <span class="token number">1</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'%d 个 9 可以被 %d 整除 : %d'</span> <span class="token operator">%</span> <span class="token punctuation">(</span>c9<span class="token punctuation">,</span>zi<span class="token punctuation">,</span><span class="token builtin">sum</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    r <span class="token operator">=</span> <span class="token builtin">sum</span> <span class="token operator">/</span> zi
    <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'%d / %d = %d'</span> <span class="token operator">%</span> <span class="token punctuation">(</span><span class="token builtin">sum</span><span class="token punctuation">,</span>zi<span class="token punctuation">,</span>r<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="086II_1886"></a>实例086：连接字符串II</h4>
<p><strong>题目</strong> 两个字符串连接程序。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">a<span class="token operator">=</span><span class="token string">'guangtou'</span>
b<span class="token operator">=</span><span class="token string">'feipang'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b<span class="token operator">+</span>a<span class="token punctuation">)</span>
</code></pre>
<h4><a id="087_1898"></a>实例087：访问类成员</h4>
<p><strong>题目</strong> 回答结果（结构体变量传递）。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">class</span> <span class="token class-name">student</span><span class="token punctuation">:</span>
        x <span class="token operator">=</span> <span class="token number">0</span>
        c <span class="token operator">=</span> <span class="token number">0</span>
    <span class="token keyword">def</span> <span class="token function">f</span><span class="token punctuation">(</span>stu<span class="token punctuation">)</span><span class="token punctuation">:</span>
        stu<span class="token punctuation">.</span>x <span class="token operator">=</span> <span class="token number">20</span>
        stu<span class="token punctuation">.</span>c <span class="token operator">=</span> <span class="token string">'c'</span>
    a<span class="token operator">=</span> student<span class="token punctuation">(</span><span class="token punctuation">)</span>
    a<span class="token punctuation">.</span>x <span class="token operator">=</span> <span class="token number">3</span>
    a<span class="token punctuation">.</span>c <span class="token operator">=</span> <span class="token string">'a'</span>
    f<span class="token punctuation">(</span>a<span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>x<span class="token punctuation">,</span>a<span class="token punctuation">.</span>c<span class="token punctuation">)</span>
</code></pre>
<h4><a id="088_1919"></a>实例088：打印星号</h4>
<p><strong>题目</strong> 读取7个数（1—50）的整数值，每读取一个值，程序打印出该值个数的＊。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'*'</span><span class="token operator">*</span><span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input a number: '</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="089_1930"></a>实例089：解码</h4>
<p><strong>题目</strong> 某个公司采用公用电话传递数据，数据是四位的整数，在传递过程中是加密的，加密规则如下：每位数字都加上5,然后用和除以10的余数代替该数字，再将第一位和第四位交换，第二位和第三位交换。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">n<span class="token operator">=</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
n <span class="token operator">=</span> <span class="token builtin">str</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
a<span class="token operator">=</span><span class="token punctuation">[</span><span class="token punctuation">]</span>
<span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    a<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token builtin">int</span><span class="token punctuation">(</span>n<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token operator">%</span><span class="token number">10</span><span class="token punctuation">)</span>
a<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>a<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token operator">=</span>a<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>a<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
a<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>a<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token operator">=</span>a<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">,</span>a<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">""</span><span class="token punctuation">.</span>join<span class="token punctuation">(</span><span class="token string">'%s'</span> <span class="token operator">%</span>s <span class="token keyword">for</span> s <span class="token keyword">in</span> a<span class="token punctuation">)</span><span class="token punctuation">)</span>

</code></pre>
<h4><a id="090_1948"></a>实例090：列表详解</h4>
<p><strong>题目</strong> 列表使用实例。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token comment">#list  </span>
<span class="token comment">#新建列表  </span>
testList<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">10086</span><span class="token punctuation">,</span><span class="token string">'中国移动'</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">]</span><span class="token punctuation">]</span>  
  
<span class="token comment">#访问列表长度  </span>
<span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>testList<span class="token punctuation">)</span>  <span class="token punctuation">)</span>
<span class="token comment">#到列表结尾  </span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>testList<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">:</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token comment">#向列表添加元素  </span>
testList<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token string">'i\'m new here!'</span><span class="token punctuation">)</span>  
  
<span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>testList<span class="token punctuation">)</span>  <span class="token punctuation">)</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>testList<span class="token punctuation">[</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span>  <span class="token punctuation">)</span>
<span class="token comment">#弹出列表的最后一个元素  </span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>testList<span class="token punctuation">.</span>pop<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>  <span class="token punctuation">)</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">len</span><span class="token punctuation">(</span>testList<span class="token punctuation">)</span>  <span class="token punctuation">)</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>testList  <span class="token punctuation">)</span>
<span class="token comment">#list comprehension  </span>
<span class="token comment">#后面有介绍，暂时掠过  </span>
matrix <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>  
<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">6</span><span class="token punctuation">]</span><span class="token punctuation">,</span>  
<span class="token punctuation">[</span><span class="token number">7</span><span class="token punctuation">,</span> <span class="token number">8</span><span class="token punctuation">,</span> <span class="token number">9</span><span class="token punctuation">]</span><span class="token punctuation">]</span>  
<span class="token keyword">print</span> <span class="token punctuation">(</span>matrix  <span class="token punctuation">)</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>matrix<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span>  <span class="token punctuation">)</span>
col2 <span class="token operator">=</span> <span class="token punctuation">[</span>row<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token keyword">for</span> row <span class="token keyword">in</span> matrix<span class="token punctuation">]</span><span class="token comment">#get a  column from a matrix  </span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>col2  <span class="token punctuation">)</span>
col2even <span class="token operator">=</span> <span class="token punctuation">[</span>row<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token keyword">for</span> row <span class="token keyword">in</span> matrix <span class="token keyword">if</span>  row<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">%</span> <span class="token number">2</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">]</span><span class="token comment">#filter odd item  </span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>col2even<span class="token punctuation">)</span>
</code></pre>
<h4><a id="091time_1985"></a>实例091：time模块</h4>
<p><strong>题目</strong> 时间函数举例1。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">import</span> time
    <span class="token keyword">print</span> <span class="token punctuation">(</span>time<span class="token punctuation">.</span>ctime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span>time<span class="token punctuation">.</span>asctime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>localtime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span>time<span class="token punctuation">.</span>asctime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>gmtime<span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="092timeII_1999"></a>实例092：time模块II</h4>
<p><strong>题目</strong> 时间函数举例2。</p>
<p><strong>程序分析</strong> 如何浪费时间。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">import</span> time
    start <span class="token operator">=</span> time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">3000</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    end <span class="token operator">=</span> time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span>
 
    <span class="token keyword">print</span> <span class="token punctuation">(</span>end <span class="token operator">-</span> start<span class="token punctuation">)</span>
</code></pre>
<h4><a id="093timeIII_2016"></a>实例093：time模块III</h4>
<p><strong>题目</strong> 时间函数举例3。</p>
<p><strong>程序分析</strong> 如何浪费时间。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">import</span> time
    start <span class="token operator">=</span> time<span class="token punctuation">.</span>clock<span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span>
    end <span class="token operator">=</span> time<span class="token punctuation">.</span>clock<span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'different is %6.3f'</span> <span class="token operator">%</span> <span class="token punctuation">(</span>end <span class="token operator">-</span> start<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="094timeIV_2032"></a>实例094：time模块IV</h4>
<p><strong>题目</strong> 时间函数举例4。</p>
<p><strong>程序分析</strong> 如何浪费时间。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">import</span> time
    <span class="token keyword">import</span> random
    
    play_it <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'do you want to play it.(\'y\' or \'n\')'</span><span class="token punctuation">)</span>
    <span class="token keyword">while</span> play_it <span class="token operator">==</span> <span class="token string">'y'</span><span class="token punctuation">:</span>
        c <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input a character:\n'</span><span class="token punctuation">)</span>
        i <span class="token operator">=</span> random<span class="token punctuation">.</span>randint<span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token operator">**</span><span class="token number">32</span><span class="token punctuation">)</span> <span class="token operator">%</span> <span class="token number">100</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'please input number you guess:\n'</span><span class="token punctuation">)</span>
        start <span class="token operator">=</span> time<span class="token punctuation">.</span>clock<span class="token punctuation">(</span><span class="token punctuation">)</span>
        a <span class="token operator">=</span> time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span>
        guess <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input your guess:\n'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token keyword">while</span> guess <span class="token operator">!=</span> i<span class="token punctuation">:</span>
            <span class="token keyword">if</span> guess <span class="token operator">&gt;</span> i<span class="token punctuation">:</span>
                <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'please input a little smaller'</span><span class="token punctuation">)</span>
                guess <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input your guess:\n'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
            <span class="token keyword">else</span><span class="token punctuation">:</span>
                <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'please input a little bigger'</span><span class="token punctuation">)</span>
                guess <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'input your guess:\n'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        end <span class="token operator">=</span> time<span class="token punctuation">.</span>clock<span class="token punctuation">(</span><span class="token punctuation">)</span>
        b <span class="token operator">=</span> time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span>
        var <span class="token operator">=</span> <span class="token punctuation">(</span>end <span class="token operator">-</span> start<span class="token punctuation">)</span> <span class="token operator">/</span> <span class="token number">18.2</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span>var<span class="token punctuation">)</span>
        <span class="token comment"># print 'It took you %6.3 seconds' % time.difftime(b,a))</span>
        <span class="token keyword">if</span> var <span class="token operator">&lt;</span> <span class="token number">15</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'you are very clever!'</span><span class="token punctuation">)</span>
        <span class="token keyword">elif</span> var <span class="token operator">&lt;</span> <span class="token number">25</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'you are normal!'</span><span class="token punctuation">)</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'you are stupid!'</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'Congradulations'</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token string">'The number you guess is %d'</span> <span class="token operator">%</span> i<span class="token punctuation">)</span>
        play_it <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'do you want to play it.'</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="095_2074"></a>实例095：转换时间格式</h4>
<p><strong>题目</strong> 字符串日期转换为易读的日期格式。</p>
<p><strong>程序分析</strong> 看看就得了，dateutil是个第三方库。</p>
<pre><code class="prism language-python"><span class="token keyword">from</span> dateutil <span class="token keyword">import</span> parser
dt <span class="token operator">=</span> parser<span class="token punctuation">.</span>parse<span class="token punctuation">(</span><span class="token string">"Aug 28 2015 12:00AM"</span><span class="token punctuation">)</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span>dt<span class="token punctuation">)</span>
</code></pre>
<h4><a id="096_2086"></a>实例096：计算复读次数</h4>
<p><strong>题目</strong> 计算字符串中子串出现的次数。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">s1<span class="token operator">=</span><span class="token string">'xuebixuebixuebixuebixuebixuebixuebixue'</span>
s2<span class="token operator">=</span><span class="token string">'xuebi'</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>s1<span class="token punctuation">.</span>count<span class="token punctuation">(</span>s2<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="097_2098"></a>实例097：磁盘写入</h4>
<p><strong>题目</strong> 从键盘输入一些字符，逐个把它们写到磁盘文件上，直到输入一个 # 为止。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">from</span> sys <span class="token keyword">import</span> stdout
    filename <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入文件名:\n'</span><span class="token punctuation">)</span>
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span>filename<span class="token punctuation">,</span><span class="token string">"w"</span><span class="token punctuation">)</span>
    ch <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'输入字符串:\n'</span><span class="token punctuation">)</span>
    <span class="token keyword">while</span> ch <span class="token operator">!=</span> <span class="token string">'#'</span><span class="token punctuation">:</span>
        fp<span class="token punctuation">.</span>write<span class="token punctuation">(</span>ch<span class="token punctuation">)</span>
        stdout<span class="token punctuation">.</span>write<span class="token punctuation">(</span>ch<span class="token punctuation">)</span>
        ch <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">''</span><span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="098II_2117"></a>实例098：磁盘写入II</h4>
<p><strong>题目</strong> 从键盘输入一个字符串，将小写字母全部转换成大写字母，然后输出到一个磁盘文件"test"中保存。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span><span class="token string">'test.txt'</span><span class="token punctuation">,</span><span class="token string">'w'</span><span class="token punctuation">)</span>
    string <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">'please input a string:\n'</span><span class="token punctuation">)</span>
    string <span class="token operator">=</span> string<span class="token punctuation">.</span>upper<span class="token punctuation">(</span><span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>write<span class="token punctuation">(</span>string<span class="token punctuation">)</span>
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span><span class="token string">'test.txt'</span><span class="token punctuation">,</span><span class="token string">'r'</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span> <span class="token punctuation">(</span>fp<span class="token punctuation">.</span>read<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="099_2134"></a>实例099：磁盘读写</h4>
<p><strong>题目</strong> 有两个磁盘文件A和B,各存放一行字母,要求把这两个文件中的信息合并(按字母顺序排列), 输出到一个新文件C中。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python"><span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">'__main__'</span><span class="token punctuation">:</span>
    <span class="token keyword">import</span> string
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span><span class="token string">'test1.txt'</span><span class="token punctuation">)</span>
    a <span class="token operator">=</span> fp<span class="token punctuation">.</span>read<span class="token punctuation">(</span><span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
 
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span><span class="token string">'test2.txt'</span><span class="token punctuation">)</span>
    b <span class="token operator">=</span> fp<span class="token punctuation">.</span>read<span class="token punctuation">(</span><span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
 
    fp <span class="token operator">=</span> <span class="token builtin">open</span><span class="token punctuation">(</span><span class="token string">'test3.txt'</span><span class="token punctuation">,</span><span class="token string">'w'</span><span class="token punctuation">)</span>
    l <span class="token operator">=</span> <span class="token builtin">list</span><span class="token punctuation">(</span>a <span class="token operator">+</span> b<span class="token punctuation">)</span>
    l<span class="token punctuation">.</span>sort<span class="token punctuation">(</span><span class="token punctuation">)</span>
    s <span class="token operator">=</span> <span class="token string">''</span>
    s <span class="token operator">=</span> s<span class="token punctuation">.</span>join<span class="token punctuation">(</span>l<span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>write<span class="token punctuation">(</span>s<span class="token punctuation">)</span>
    fp<span class="token punctuation">.</span>close<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre>
<h4><a id="100_2160"></a>实例100：列表转字典</h4>
<p><strong>题目</strong> 列表转换为字典。</p>
<p><strong>程序分析</strong> 无。</p>
<pre><code class="prism language-python">i <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span><span class="token punctuation">]</span>
l <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">]</span>
<span class="token keyword">print</span> <span class="token punctuation">(</span><span class="token builtin">dict</span><span class="token punctuation">(</span><span class="token builtin">zip</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span>l<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>

                                    </div>
                <link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-b6c3c6d139.css" rel="stylesheet">
                                                <div class="more-toolbox">
                <div class="left-toolbox">
                    <ul class="toolbox-list">
                        
                        <li class="tool-item tool-active is-like "><a href="javascript:;"><svg class="icon" aria-hidden="true">
                            <use xlink:href="#csdnc-thumbsup"></use>
                        </svg><span class="name">点赞</span>
                        <span class="count">310</span>
                        </a></li>
                        <li class="tool-item tool-active is-collection "><a href="javascript:;" data-report-click='{"mod":"popu_824"}'><svg class="icon" aria-hidden="true">
                            <use xlink:href="#icon-csdnc-Collection-G" ></use>
                        </svg><span class="name">收藏</span></a></li>
                        <li class="tool-item tool-active is-share"><a href="javascript:;" data-report-click='{"mod":"1582594662_002"}'><svg class="icon" aria-hidden="true">
                            <use xlink:href="#icon-csdnc-fenxiang"></use>
                        </svg>分享</a></li>
                        <!--打赏开始-->
                                                <!--打赏结束-->
                                                <li class="tool-item tool-more">
                            <a>
                            <svg t="1575545411852" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5717" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M179.176 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5718"></path><path d="M509.684 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5719"></path><path d="M846.175 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5720"></path></svg>
                            </a>
                            <ul class="more-box">
                                <li class="item"><a class="article-report">文章举报</a></li>
                            </ul>
                        </li>
                                            </ul>
                </div>
                            </div>
            <div class="person-messagebox">
                <div class="left-message"><a href="https://blog.csdn.net/weixin_41084236">
                    <img src="https://profile.csdnimg.cn/1/F/3/3_weixin_41084236" class="avatar_pic" username='weixin_41084236'>
                                            <img src="https://g.csdnimg.cn/static/user-reg-year/1x/2.png" class="user-years">
                                    </a></div>
                <div class="middle-message">
                                        <div class="title"><span class="tit"><a href="https://blog.csdn.net/weixin_41084236" data-report-click='{"mod":"popu_379"}' target="_blank">超级大黄狗Shawn</a></span>
                                            </div>
                    <div class="text"><span>发布了33 篇原创文章</span> · <span>获赞 335</span> · <span>访问量 18万+</span></div>
                </div>
                                <div class="right-message">
                                            <a href=https://im.csdn.net/im/main.html?userName=weixin_41084236 target="_blank" 
                            class="btn btn-sm btn-red-hollow bt-button personal-letter">私信
                        </a>
                                                            <a class="btn btn-sm  bt-button personal-watch" data-report-click='{"mod":"popu_379"}'>关注</a>
                                    </div>
                            </div>
                    </div>
    </article>
    
</div>


                        <div class="hide-article-box hide-article-pos text-center">
                <a class="btn-readmore" data-report-view='{"mod":"popu_376","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963","strategy":"readmore"}' data-report-click='{"mod":"popu_376","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963","strategy":"readmore"}'>
                    展开阅读全文
                    <svg class="icon chevrondown" aria-hidden="true">
                        <use xlink:href="#csdnc-chevrondown"></use>
                    </svg>
                </a>
            </div>
        

    <script>
    $("#blog_detail_zk_collection").click(function(){
        window.csdn.articleCollection()
    })
</script>

            <div id="dmp_ad_58"><div id="kp_box_58" data-pid="58"><div style="width:100%;background:#fff;border:3px solid #fff;padding:16px 0px 0px 0px;">
<script type="text/javascript" src="//static.mediav.com/js/mvf_news_feed.js"></script>
<div id="three_ad1" class="mediav_ad" ></div>
<script>
                                               NEWS_FEED({
                w: 900,
                h : 100,
                showid : 'ztvJV8',
                placeholderId: "three_ad1",
                inject : 'define',
                define : {
                    imagePosition : 'left',
                    imageBorderRadius : 0,
                    imageWidth: 90,
                    imageHeight: 68,
                    imageFill : 'clip',
                    displayImage : true,
                    displayTitle : true,
                    titleFontSize: 18,
                    titleFontColor: '#000',
                    titleFontFamily : 'Lato,-apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif',
                    titleFontWeight: 'bold',
                    titlePaddingTop : 0,
                    titlePaddingRight : 0,
                    titlePaddingBottom : 5,
                    titlePaddingLeft : 16,
                    displayDesc : true,
                    descFontSize: 14,
                    descFontColor: '#8e959a',
                    descFontFamily : 'Microsoft YaHei',
                    paddingTop : 10,
                    paddingRight : 0,
                    paddingBottom : 0,
                    paddingLeft : 20,
                    backgroundColor: '#fff',
                    hoverColor: '#000'
                      }
                  })
                                        </script>
</div><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=58&a=402&c=0&k=&d=1&t=3&u=275ccf451f244bbc864aadafc6c8e72d"></div></div>            
            <a id="commentBox" name="commentBox"></a>
<div class="comment-box">
	<div class="comment-edit-box d-flex">
		<a id="commentsedit"></a>
		<div class="user-img">
			<a href="javascript:void(0);" target="_blank" rel="noopener">
				<img class="show_loginbox" src="//g.csdnimg.cn/static/user-img/anonymous-User-img.png">
			</a>
		</div>
		<form id="commentform">
			<input type="hidden" id="comment_replyId">
			<textarea class="comment-content" name="comment_content" id="comment_content" placeholder="想对作者说点什么" maxlength="1000"></textarea>
			<div class="opt-box"> <!-- d-flex -->
				<div id="ubbtools" class="add_code">
					<a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
				</div>
				<input type="hidden" id="comment_replyId" name="comment_replyId">
				<input type="hidden" id="article_id" name="article_id" value="81564963">
				<input type="hidden" id="comment_userId" name="comment_userId" value="">
				<input type="hidden" id="commentId" name="commentId" value="">
				<div style="display: none;" class="csdn-tracking-statistics tracking-click" data-report-click='{"mod":"popu_384","dest":""}'><a href="#" target="_blank" class="comment_area_btn" rel="noopener">发表评论</a></div>
				<div class="dropdown" id="myDrap">
					<a class="dropdown-face d-flex align-items-center" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
					<div class="txt-selected text-truncate">添加代码片</div>
					<svg class="icon d-block" aria-hidden="true">
						<use xlink:href="#csdnc-triangledown"></use>
					</svg>
					</a>
					<ul class="dropdown-menu" id="commentCode" aria-labelledby="drop4">
						<li><a data-code="html">HTML/XML</a></li>
						<li><a data-code="objc">objective-c</a></li>
						<li><a data-code="ruby">Ruby</a></li>
						<li><a data-code="php">PHP</a></li>
						<li><a data-code="csharp">C</a></li>
						<li><a data-code="cpp">C++</a></li>
						<li><a data-code="javascript">JavaScript</a></li>
						<li><a data-code="python">Python</a></li>
						<li><a data-code="java">Java</a></li>
						<li><a data-code="css">CSS</a></li>
						<li><a data-code="sql">SQL</a></li>
						<li><a data-code="plain">其它</a></li>
					</ul>
				</div>  
				<div class="right-box">
                                        <span id="tip_comment" class="tip">还能输入<em>1000</em>个字符</span>
					<input type="button" class="btn btn-sm btn-cancel d-none" value="取消回复">
					<a data-report-click='{"mod":"1582594662_003"}'><input type="submit" class="btn btn-sm btn-red btn-comment" value="发表评论"></a>
				</div>
			</div>
		</form>
	</div>

	<div class="comment-list-container">
		<a id="comments"></a>
		<div class="comment-list-box">
		</div>
		<div id="commentPage" class="pagination-box d-none"></div>
		<div class="opt-box text-center">
			<div class="btn btn-sm btn-link-blue" id="btnMoreComment"></div>
		</div>
	</div>
</div>
            <div class="recommend-box">
                                    <div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/dajiangtai007/article/details/65632987" target="_blank"  rel="noopener" title="【Python精华】100个Python练手小程序" data-report-click='{"mod":"popu_387","index":"1","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/dajiangtai007\/article\/details\/65632987"}' data-report-view='{"mod":"popu_387","index":"1","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/dajiangtai007\/article\/details\/65632987"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				【Python精华】100个Python练手小程序		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">03-24</span>
				<span class="read-num hover-hide">
					阅读数 
					13万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/dajiangtai007/article/details/65632987" target="_blank" rel="noopener" title="【Python精华】100个Python练手小程序">
				<span class="desc oneline">100个Python练手小程序，学习python的很好的资料，覆盖了python中的每一部分，可以边学习边练习，更容易掌握python。【程序1】 题目：有1、2、3、4个数字，能组成多少个互不相同且...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/dajiangtai007">来自：	<span class="blog_title"> 大数据研习社</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/Ch97CKd/article/details/80823328" target="_blank"  rel="noopener" title="18个Python爬虫实战案例（已开源）" data-report-click='{"mod":"popu_387","index":"2","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Ch97CKd\/article\/details\/80823328"}' data-report-view='{"mod":"popu_387","index":"2","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Ch97CKd\/article\/details\/80823328"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				18个Python爬虫实战案例（已开源）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">06-26</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/Ch97CKd/article/details/80823328" target="_blank" rel="noopener" title="18个Python爬虫实战案例（已开源）">
				<span class="desc oneline">目录爬虫小工具文件下载小助手爬虫实战笔趣看小说下载VIP视频下载百度文库文章下载_rev1百度文库文章下载_rev2《帅啊》网帅哥图片下载构建代理IP池《火影忍者》漫画下......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/Ch97CKd">来自：	<span class="blog_title"> 突围的鱼</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_41597912/article/details/79710972" target="_blank"  rel="noopener" title="十个Python练手的实战项目，学会这些Python就基本没问题了" data-report-click='{"mod":"popu_387","index":"3","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_41597912\/article\/details\/79710972"}' data-report-view='{"mod":"popu_387","index":"3","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_41597912\/article\/details\/79710972"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				十个Python练手的实战项目，学会这些Python就基本没问题了		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">03-27</span>
				<span class="read-num hover-hide">
					阅读数 
					10万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_41597912/article/details/79710972" target="_blank" rel="noopener" title="十个Python练手的实战项目，学会这些Python就基本没问题了">
				<span class="desc oneline">话不多说，直接开搞！练习项目一：即时标记这里还是要推荐下小编的Python学习群:483546416，不管你是小白还是大牛，小编我都欢迎，不定期分享干货，包括小编自己整理的一份2017最新的Pytho...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_41597912">来自：	<span class="blog_title"> Python达人</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_42712463/article/details/86065521" target="_blank"  rel="noopener" title="分享7个python案例，python真的无所不能且容易上手（带源码）" data-report-click='{"mod":"popu_387","index":"4","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42712463\/article\/details\/86065521"}' data-report-view='{"mod":"popu_387","index":"4","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42712463\/article\/details\/86065521"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				分享7个python案例，python真的无所不能且容易上手（带源码）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">01-08</span>
				<span class="read-num hover-hide">
					阅读数 
					5729</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_42712463/article/details/86065521" target="_blank" rel="noopener" title="分享7个python案例，python真的无所不能且容易上手（带源码）">
				<span class="desc oneline">本文共分享七个案例；分别是：完整源码私信小编01获取。1，抓取知乎图片，只用30行代码：学习资料也可以加下Python扣扣裙：3零4零5零799自己下载学习下2、没事闲的时候，听两个聊天机器人互相聊天...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_42712463">来自：	<span class="blog_title"> qq_42712463的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_59" data-pid="59"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-format="fluid"
     data-ad-layout-key="-gp-e+1c-4d+81"
     data-ad-client="ca-pub-1076724771190722"
     data-ad-slot="2356783728"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=59&a=944&c=0&k=&d=1&t=3&u=7529c9cfe4c94e8183b367aec84c700c"></div></div>
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/weixin_44941957/article/details/89739681" target="_blank"  rel="noopener" title="最新Python教程全套合集项目实战(完整)" data-report-click='{"mod":"popu_387","index":"5","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_44941957\/article\/details\/89739681"}' data-report-view='{"mod":"popu_387","index":"5","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_44941957\/article\/details\/89739681"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				最新Python教程全套合集项目实战(完整)		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">05-01</span>
				<span class="read-num hover-hide">
					阅读数 
					4901</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/weixin_44941957/article/details/89739681" target="_blank" rel="noopener" title="最新Python教程全套合集项目实战(完整)">
				<span class="desc oneline">资源属性：资源大小：128.27G文件数量：1313个文件，113个文件夹如果因为文件太多无法一次保存，请分批次逐一保存，切勿心急!01-python2018黑马基础班1-1Linux基础1-2pyt...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_44941957">来自：	<span class="blog_title"> weixin_44941957的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/I_love_you_dandan/article/details/102901472" target="_blank"  rel="noopener" title="Python实例大全（基于Python3.7.4）" data-report-click='{"mod":"popu_387","index":"6","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/I_love_you_dandan\/article\/details\/102901472"}' data-report-view='{"mod":"popu_387","index":"6","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/I_love_you_dandan\/article\/details\/102901472"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				Python实例大全（基于Python3.7.4）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-04</span>
				<span class="read-num hover-hide">
					阅读数 
					4万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/I_love_you_dandan/article/details/102901472" target="_blank" rel="noopener" title="Python实例大全（基于Python3.7.4）">
				<span class="desc oneline">博客说明：这是自己写的有关python语言的一篇综合博客。只作为知识广度和编程技巧学习，不过于追究学习深度，点到即止、会用即可。主要是基础语句，如三大控制语句（顺序、分支、循环），随机数的生成，数据类...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/I_love_you_dandan">来自：	<span class="blog_title"> 归零者</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_42271991/article/details/81535703" target="_blank"  rel="noopener" title="100个python进阶实战小项目（适合新手） 微信撤回查看|抖音批量下载等" data-report-click='{"mod":"popu_387","index":"7","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42271991\/article\/details\/81535703"}' data-report-view='{"mod":"popu_387","index":"7","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42271991\/article\/details\/81535703"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				100个python进阶实战小项目（适合新手） 微信撤回查看|抖音批量下载等		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">08-09</span>
				<span class="read-num hover-hide">
					阅读数 
					1336</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_42271991/article/details/81535703" target="_blank" rel="noopener" title="100个python进阶实战小项目（适合新手） 微信撤回查看|抖音批量下载等">
				<span class="desc oneline">Hi~，各位小伙伴，Python是目前编程语言中的主流语言之一，也是公认最容易入门的编程语言，因为Python语言近几年的火爆，有很多小伙伴都开始学习这门语言。编程语言学习，最重要的是“多看代码，多敲...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_42271991">来自：	<span class="blog_title"> qq_42271991的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_35527032/article/details/81023121" target="_blank"  rel="noopener" title="几个好玩有趣的Python入门实例" data-report-click='{"mod":"popu_387","index":"8","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35527032\/article\/details\/81023121"}' data-report-view='{"mod":"popu_387","index":"8","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35527032\/article\/details\/81023121"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				几个好玩有趣的Python入门实例		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">07-12</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_35527032/article/details/81023121" target="_blank" rel="noopener" title="几个好玩有趣的Python入门实例">
				<span class="desc oneline">几个简单的Python实例，好玩有趣，基础语法。turtle库开始自己的绘画写一个属于自己的文本进度条蒙特卡洛方法计算π分形几何，Koch雪花曲线输入一组数据，进行简单的统计小说词频统计，统计三国演义...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_35527032">来自：	<span class="blog_title"> Tiko.T的部落格</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/A_Ainley/article/details/104168299" target="_blank"  rel="noopener" title="快速入门（完整）：Python实例100个（基于最新Python3.7版本）+ 源代码" data-report-click='{"mod":"popu_387","index":"9","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/A_Ainley\/article\/details\/104168299"}' data-report-view='{"mod":"popu_387","index":"9","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/A_Ainley\/article\/details\/104168299"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				快速入门（完整）：Python实例100个（基于最新Python3.7版本）+ 源代码		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">02-04</span>
				<span class="read-num hover-hide">
					阅读数 
					424</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/A_Ainley/article/details/104168299" target="_blank" rel="noopener" title="快速入门（完整）：Python实例100个（基于最新Python3.7版本）+ 源代码">
				<span class="desc oneline">前言雪花儿要学Python，于是鱼丸儿根据另一个CSDN老哥整理的完整版Python经典入门100例，加上了自己之前学习时的源代码，整理了一下，也方便日后同学们的代码取用。原文地址：快速入门（完整）：...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/A_Ainley">来自：	<span class="blog_title"> A_Ainley的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_60" data-pid="60"><script type="text/javascript">
    (function() {
        var s = "_" + Math.random().toString(36).slice(2);
        document.write('<div style="" id="' + s + '"></div>');
        (window.slotbydup = window.slotbydup || []).push({
            id: "u3491668",
            container:  s
        });
    })();
</script>
<!-- 多条广告如下脚本只需引入一次 -->
<script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/c.js" async="async" defer="defer" ></script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=60&a=78&c=0&k=&d=1&t=3&u=945578a7045d4596b3b979bc45176424"></div></div>
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_35190492/article/details/103105780" target="_blank"  rel="noopener" title="阿里面试官问我：如何设计秒杀系统？我的回答让他比起大拇指" data-report-click='{"mod":"popu_387","index":"10","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35190492\/article\/details\/103105780"}' data-report-view='{"mod":"popu_387","index":"10","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35190492\/article\/details\/103105780"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				阿里面试官问我：如何设计秒杀系统？我的回答让他比起大拇指		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-18</span>
				<span class="read-num hover-hide">
					阅读数 
					6万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_35190492/article/details/103105780" target="_blank" rel="noopener" title="阿里面试官问我：如何设计秒杀系统？我的回答让他比起大拇指">
				<span class="desc oneline">csdn把秒杀设计得最好的文章了。</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_35190492">来自：	<span class="blog_title"> 敖丙</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/valada/article/details/79982704" target="_blank"  rel="noopener" title="Python 快速入门实战教程" data-report-click='{"mod":"popu_387","index":"11","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/valada\/article\/details\/79982704"}' data-report-view='{"mod":"popu_387","index":"11","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/valada\/article\/details\/79982704"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				Python 快速入门实战教程		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">04-17</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/valada/article/details/79982704" target="_blank" rel="noopener" title="Python 快速入门实战教程">
				<span class="desc oneline">课程介绍2017年末，Python在国务院《新一代人工智能发展规划的通知》中被列入教学大纲，一时风头无两。Python因其在人工智能领域的先天优势，深受欢迎，不难预见，它在未来将大有可为。两年前，因项...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/valada">来自：	<span class="blog_title"> GitChat</span></a>
												</span>
		</p>
	</div>
	</div>

	
			<div class="recommend-item-box blog-expert-recommend-box">
			<div class="d-flex">
				<div class="blog-expert-recommend">
					<div class="blog-expert">
						<div class="blog-expert-flexbox"></div>
					</div>
				</div>
			</div>
		</div>
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_38161040/article/details/87295245" target="_blank"  rel="noopener" title="Python 入门篇-最新版python3.7.2的安装。" data-report-click='{"mod":"popu_387","index":"12","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_38161040\/article\/details\/87295245"}' data-report-view='{"mod":"popu_387","index":"12","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_38161040\/article\/details\/87295245"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				Python 入门篇-最新版python3.7.2的安装。		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">04-12</span>
				<span class="read-num hover-hide">
					阅读数 
					7284</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_38161040/article/details/87295245" target="_blank" rel="noopener" title="Python 入门篇-最新版python3.7.2的安装。">
				<span class="desc oneline">首先我们来下载python：Python官方网站获取。说明：这里的64不是指通常的64位，虽然我的操作系统是64位的，但是我的指令集是EM64T的，所以我下载x86的，如果细心的你点下载x86-64后...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_38161040">来自：	<span class="blog_title"> 小蓝枣的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/fei347795790/article/details/102838861" target="_blank"  rel="noopener" title="超实用的 30 段 Python 案例（一）" data-report-click='{"mod":"popu_387","index":"13","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/fei347795790\/article\/details\/102838861"}' data-report-view='{"mod":"popu_387","index":"13","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/fei347795790\/article\/details\/102838861"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				超实用的 30 段 Python 案例（一）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-31</span>
				<span class="read-num hover-hide">
					阅读数 
					1680</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/fei347795790/article/details/102838861" target="_blank" rel="noopener" title="超实用的 30 段 Python 案例（一）">
				<span class="desc oneline">Python是目前最流行的语言之一，它在数据科学、机器学习、web开发、脚本编写、自动化方面被许多人广泛使用。它的简单和易用性造就了它如此流行的原因。如果你正在阅读本文，那么你或多或少已经使用过Pyt...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/fei347795790">来自：	<span class="blog_title"> fei347795790的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_35190492/article/details/103153444" target="_blank"  rel="noopener" title="面试官问我：什么是消息队列？什么场景需要他？用了会出现什么问题？" data-report-click='{"mod":"popu_387","index":"14","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35190492\/article\/details\/103153444"}' data-report-view='{"mod":"popu_387","index":"14","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35190492\/article\/details\/103153444"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				面试官问我：什么是消息队列？什么场景需要他？用了会出现什么问题？		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-20</span>
				<span class="read-num hover-hide">
					阅读数 
					6万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_35190492/article/details/103153444" target="_blank" rel="noopener" title="面试官问我：什么是消息队列？什么场景需要他？用了会出现什么问题？">
				<span class="desc oneline">什么是消息队列你了解过么?</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_35190492">来自：	<span class="blog_title"> 敖丙</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_61" data-pid="61"><div id="three_ad1" class="mediav_ad" ></div>
<script type="text/javascript" src="//static.mediav.com/js/mvf_news_feed.js"></script>
<script>
                                               NEWS_FEED({
                w: 852,
                h : 52,
                showid : 'GNKXx7',
                placeholderId: "three_ad1",
                inject : 'define',
                define : {
                    imagePosition : 'left',
                    imageBorderRadius : 3,
                    imageWidth: 90,
                    imageHeight: 52,
                    imageFill : 'clip',
                    displayImage : true,
                    displayTitle : true,
                    titleFontSize: 18,
                    titleFontColor: '#000',
                    titleFontFamily : 'Lato,-apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif',
                    titleFontWeight: 'bold',
                    titlePaddingTop : 0,
                    titlePaddingRight : 0,
                    titlePaddingBottom : 5,
                    titlePaddingLeft : 16,
                    displayDesc : true,
                    descFontSize: 14,
                    descFontColor: '#8e959a',
                    descFontFamily : 'Microsoft Yahei',
                    paddingTop : 0,
                    paddingRight : 0,
                    paddingBottom : 0,
                    paddingLeft : 0,
                    backgroundColor: '#fff',
                    hoverColor: '#000'
                      }
                  })
                                        </script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=61&a=517&c=0&k=&d=1&t=3&u=230c4cd2073d43ba9d310b12484def27"></div></div>
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_42554007/article/details/102802719" target="_blank"  rel="noopener" title="python学习方法总结(内附python全套学习资料)" data-report-click='{"mod":"popu_387","index":"15","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42554007\/article\/details\/102802719"}' data-report-view='{"mod":"popu_387","index":"15","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42554007\/article\/details\/102802719"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				python学习方法总结(内附python全套学习资料)		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-03</span>
				<span class="read-num hover-hide">
					阅读数 
					5万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_42554007/article/details/102802719" target="_blank" rel="noopener" title="python学习方法总结(内附python全套学习资料)">
				<span class="desc oneline">不要再问我python好不好学了我之前做过半年少儿编程老师，一个小学四年级的小孩子都能在我的教学下独立完成python游戏，植物大战僵尸简单版，如果要肯花时间，接下来的网络开发也不是问题，人工智能也可...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_42554007">来自：	<span class="blog_title"> 一行数据</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/puran1218/article/details/104563081" target="_blank"  rel="noopener" title="02 神经网络 - 神经网络和深度学习 [Deep Learning Specialization系列]" data-report-click='{"mod":"popu_387","index":"16","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/puran1218\/article\/details\/104563081"}' data-report-view='{"mod":"popu_387","index":"16","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/puran1218\/article\/details\/104563081"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				02 神经网络 - 神经网络和深度学习 [Deep Learning Specialization系列]		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">02-28</span>
				<span class="read-num hover-hide">
					阅读数 
					389</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/puran1218/article/details/104563081" target="_blank" rel="noopener" title="02 神经网络 - 神经网络和深度学习 [Deep Learning Specialization系列]">
				<span class="desc oneline">本文简单描述了逻辑回归和二进制分类，损失函数、代价函数和梯度递减法，计算图、正向传播和反向传播，向量化等内容...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/puran1218">来自：	<span class="blog_title"> puran1218的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/weixin_34055910/article/details/90334401" target="_blank"  rel="noopener" title="几个小例子告诉你, 一行Python代码能干哪些事" data-report-click='{"mod":"popu_387","index":"17","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_34055910\/article\/details\/90334401"}' data-report-view='{"mod":"popu_387","index":"17","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_34055910\/article\/details\/90334401"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				几个小例子告诉你, 一行Python代码能干哪些事		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-31</span>
				<span class="read-num hover-hide">
					阅读数 
					66</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/weixin_34055910/article/details/90334401" target="_blank" rel="noopener" title="几个小例子告诉你, 一行Python代码能干哪些事">
				<span class="desc oneline">首先你要了解一下Python之禅，一行代码输出“The Zen of Python”：python-c&quot;importthis&quot;&quot;&quot;&quot;TheZenofPython,byTimPetersBeautifu...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_34055910">来自：	<span class="blog_title"> weixin_34055910的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/xie_0723/article/details/79775539" target="_blank"  rel="noopener" title="Atom Python 配置Python3 解释器" data-report-click='{"mod":"popu_387","index":"18","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xie_0723\/article\/details\/79775539"}' data-report-view='{"mod":"popu_387","index":"18","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xie_0723\/article\/details\/79775539"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				Atom Python 配置Python3 解释器		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">04-01</span>
				<span class="read-num hover-hide">
					阅读数 
					5628</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/xie_0723/article/details/79775539" target="_blank" rel="noopener" title="Atom Python 配置Python3 解释器">
				<span class="desc oneline">环境MacPython3.6.4Atom背景Atom执行PythonCode使用ScriptPackage，执行快捷键cmd+i。但是默认是执行Mac系统的2.7版本的Python。配置cmd+，(c...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/xie_0723">来自：	<span class="blog_title"> xie_0723的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_16855077/article/details/104569388" target="_blank"  rel="noopener" title="【多线程并发编程】十一 生产者和消费者问题(面试必问)" data-report-click='{"mod":"popu_387","index":"19","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_16855077\/article\/details\/104569388"}' data-report-view='{"mod":"popu_387","index":"19","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_16855077\/article\/details\/104569388"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				【多线程并发编程】十一 生产者和消费者问题(面试必问)		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">02-29</span>
				<span class="read-num hover-hide">
					阅读数 
					402</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_16855077/article/details/104569388" target="_blank" rel="noopener" title="【多线程并发编程】十一 生产者和消费者问题(面试必问)">
				<span class="desc oneline">经典面试题，生产者和消费者问题</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_16855077">来自：	<span class="blog_title"> 程序猿学社的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_62" data-pid="62"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-format="fluid"
     data-ad-layout-key="-gp-e+1c-4d+81"
     data-ad-client="ca-pub-1076724771190722"
     data-ad-slot="2356783728"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=62&a=944&c=0&k=&d=1&t=3&u=d2bbc3d6cb7541d78f9049e5aad14a25"></div></div>
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/YKenan/article/details/88135978" target="_blank"  rel="noopener" title="Windows 安装 Python3.7" data-report-click='{"mod":"popu_387","index":"20","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/YKenan\/article\/details\/88135978"}' data-report-view='{"mod":"popu_387","index":"20","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/YKenan\/article\/details\/88135978"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				Windows 安装 Python3.7		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">03-04</span>
				<span class="read-num hover-hide">
					阅读数 
					1503</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/YKenan/article/details/88135978" target="_blank" rel="noopener" title="Windows 安装 Python3.7">
				<span class="desc oneline">Windows x64安装Python3.71.下载python3.7网址：https://www.python.org/getit/2.安装python3.7按照图片进行安装吧！3.配置python...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/YKenan">来自：	<span class="blog_title"> YKenan的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/Mu_Xiaoye/article/details/104559874" target="_blank"  rel="noopener" title="北京大学肖臻老师《区块链技术与应用》公开课笔记21——ETH挖矿算法篇1" data-report-click='{"mod":"popu_387","index":"21","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Mu_Xiaoye\/article\/details\/104559874"}' data-report-view='{"mod":"popu_387","index":"21","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Mu_Xiaoye\/article\/details\/104559874"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				北京大学肖臻老师《区块链技术与应用》公开课笔记21——ETH挖矿算法篇1		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">03-01</span>
				<span class="read-num hover-hide">
					阅读数 
					660</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/Mu_Xiaoye/article/details/104559874" target="_blank" rel="noopener" title="北京大学肖臻老师《区块链技术与应用》公开课笔记21——ETH挖矿算法篇1">
				<span class="desc oneline">北京大学肖臻老师《区块链技术与应用》公开课笔记以太坊GHOST协议，对应肖老师视频：click here全系列笔记请见：click here若导航页点击跳转失败，则为该页由于CSDN平台审核造成。由于...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/Mu_Xiaoye">来自：	<span class="blog_title"> Sinocifengs的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/u011738045/article/details/84024670" target="_blank"  rel="noopener" title="python3.7 最新面试题大全(总结)--1" data-report-click='{"mod":"popu_387","index":"22","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/u011738045\/article\/details\/84024670"}' data-report-view='{"mod":"popu_387","index":"22","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/u011738045\/article\/details\/84024670"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				python3.7 最新面试题大全(总结)--1		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-13</span>
				<span class="read-num hover-hide">
					阅读数 
					537</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/u011738045/article/details/84024670" target="_blank" rel="noopener" title="python3.7 最新面试题大全(总结)--1">
				<span class="desc oneline">1 python中is 和== 比较的区别？is 比较两个对象的内存地址是否相同，== 比较连个对象的数据是否相等2 Python中文件读写read,readline,readlines函数的区别？r...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/u011738045">来自：	<span class="blog_title"> daTou</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/bowei026/article/details/90112056" target="_blank"  rel="noopener" title="python3.7入门系列十 类和对象" data-report-click='{"mod":"popu_387","index":"23","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/bowei026\/article\/details\/90112056"}' data-report-view='{"mod":"popu_387","index":"23","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/bowei026\/article\/details\/90112056"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				python3.7入门系列十 类和对象		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">05-11</span>
				<span class="read-num hover-hide">
					阅读数 
					146</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/bowei026/article/details/90112056" target="_blank" rel="noopener" title="python3.7入门系列十 类和对象">
				<span class="desc oneline">类在面向对象编程中，类是定义对象的通用行为和属性，是对象的模板。根据类可以创建对象，叫对象实例化。创建Person 类class Person:  def __init__(self, name, a...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/bowei026">来自：	<span class="blog_title"> 跟着互联网</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/katyusha1/article/details/78380421" target="_blank"  rel="noopener" title="python3爬虫攻略（7）：爬虫案例" data-report-click='{"mod":"popu_387","index":"24","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/katyusha1\/article\/details\/78380421"}' data-report-view='{"mod":"popu_387","index":"24","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/katyusha1\/article\/details\/78380421"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				python3爬虫攻略（7）：爬虫案例		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-28</span>
				<span class="read-num hover-hide">
					阅读数 
					654</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/katyusha1/article/details/78380421" target="_blank" rel="noopener" title="python3爬虫攻略（7）：爬虫案例">
				<span class="desc oneline">上一篇学了xpath，那么我们趁热打铁，用xpath和python来写一个简单的小爬虫，爬取豆瓣电影top250的电影名字和评分，并将其写入到本地txt文件中。好了进入正题。 通过对网页进行分析，我们...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/katyusha1">来自：	<span class="blog_title"> katyusha1的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/java_sha/article/details/100895297" target="_blank"  rel="noopener" title="从入门到精通，Java学习路线导航（附学习资源）" data-report-click='{"mod":"popu_387","index":"25","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/java_sha\/article\/details\/100895297"}' data-report-view='{"mod":"popu_387","index":"25","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/java_sha\/article\/details\/100895297"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				从入门到精通，Java学习路线导航（附学习资源）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">09-16</span>
				<span class="read-num hover-hide">
					阅读数 
					10万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/java_sha/article/details/100895297" target="_blank" rel="noopener" title="从入门到精通，Java学习路线导航（附学习资源）">
				<span class="desc oneline">引言最近也有很多人来向我&quot;请教&quot;，他们大都是一些刚入门的新手，还不了解这个行业，也不知道从何学起，开始的时候非常迷茫，实在是每天回复很多人也很麻烦，所以在这里统一作个回复吧。Java学习路线当然，这里...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/java_sha">来自：	<span class="blog_title"> java_sha的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_40630246/article/details/102643196" target="_blank"  rel="noopener" title="c++制作的植物大战僵尸（开源项目）" data-report-click='{"mod":"popu_387","index":"26","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_40630246\/article\/details\/102643196"}' data-report-view='{"mod":"popu_387","index":"26","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_40630246\/article\/details\/102643196"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				c++制作的植物大战僵尸（开源项目）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">01-10</span>
				<span class="read-num hover-hide">
					阅读数 
					4万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_40630246/article/details/102643196" target="_blank" rel="noopener" title="c++制作的植物大战僵尸（开源项目）">
				<span class="desc oneline">此游戏全部由本人自己制作完成。游戏大部分的素材来源于原版游戏素材，少部分搜集于网络，以及自己制作。 此游戏为同人游戏而且仅供学习交流使用，任何人未经授权，不得对本游戏进行更改、盗用等，否则后果自负。目...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_40630246">来自：	<span class="blog_title"> 尔灵尔亿的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/jikexueyuan5555/article/details/77618537" target="_blank"  rel="noopener" title="python几个应用实例" data-report-click='{"mod":"popu_387","index":"27","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/jikexueyuan5555\/article\/details\/77618537"}' data-report-view='{"mod":"popu_387","index":"27","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/jikexueyuan5555\/article\/details\/77618537"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				python几个应用实例		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">08-27</span>
				<span class="read-num hover-hide">
					阅读数 
					4863</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/jikexueyuan5555/article/details/77618537" target="_blank" rel="noopener" title="python几个应用实例">
				<span class="desc oneline">偶然间发现各路大牛的一些python创作，不得不说python是一个比较全面的语言，附上网址以后可能需要用到python视觉处理，爬虫数据分析的时候可以用的上吧2333python小项目:http:/...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/jikexueyuan5555">来自：	<span class="blog_title"> 王甲评的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/Neuf_Soleil/article/details/102788866" target="_blank"  rel="noopener" title="Vue + Spring Boot 项目实战（十四）：用户认证方案与完善的访问拦截" data-report-click='{"mod":"popu_387","index":"28","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Neuf_Soleil\/article\/details\/102788866"}' data-report-view='{"mod":"popu_387","index":"28","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Neuf_Soleil\/article\/details\/102788866"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				Vue + Spring Boot 项目实战（十四）：用户认证方案与完善的访问拦截		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-03</span>
				<span class="read-num hover-hide">
					阅读数 
					3万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/Neuf_Soleil/article/details/102788866" target="_blank" rel="noopener" title="Vue + Spring Boot 项目实战（十四）：用户认证方案与完善的访问拦截">
				<span class="desc oneline">本篇文章主要讲解 token、session 等用户认证方案的区别并分析常见误区，以及如何通过前后端的配合实现完善的访问拦截，为下一步权限控制的实现打下基础。...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/Neuf_Soleil">来自：	<span class="blog_title"> Evan 的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_41306364/article/details/103135904" target="_blank"  rel="noopener" title="【管理系统课程设计】美少女手把手教你后台管理" data-report-click='{"mod":"popu_387","index":"29","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_41306364\/article\/details\/103135904"}' data-report-view='{"mod":"popu_387","index":"29","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_41306364\/article\/details\/103135904"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				【管理系统课程设计】美少女手把手教你后台管理		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-19</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_41306364/article/details/103135904" target="_blank" rel="noopener" title="【管理系统课程设计】美少女手把手教你后台管理">
				<span class="desc oneline">【文章后台管理系统】URL设计与建模分析+项目源码+运行界面栏目管理、文章列表、用户管理、角色管理、权限管理模块（文章最后附有源码）1. 这是一个什么系统?1.1 学习后台管理系统的原因随着时代的变迁...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_41306364">来自：	<span class="blog_title"> 程序媛乐园</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/hollis_chuang/article/details/103045322" target="_blank"  rel="noopener" title="告别动态规划，连刷40道动规算法题，我总结了动规的套路" data-report-click='{"mod":"popu_387","index":"30","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/hollis_chuang\/article\/details\/103045322"}' data-report-view='{"mod":"popu_387","index":"30","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/hollis_chuang\/article\/details\/103045322"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				告别动态规划，连刷40道动规算法题，我总结了动规的套路		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-13</span>
				<span class="read-num hover-hide">
					阅读数 
					5512</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/hollis_chuang/article/details/103045322" target="_blank" rel="noopener" title="告别动态规划，连刷40道动规算法题，我总结了动规的套路">
				<span class="desc oneline">对于动态规划，春招秋招时好多题都会用到动态规划，一气之下，再 leetcode 连续刷了几十道动态规划的题在这里插入图片描述之后，豁然开朗 ，感觉动态规划也不是很难，今天......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/hollis_chuang">来自：	<span class="blog_title"> HollisChuang's Blog</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/loongggdroid/article/details/102829823" target="_blank"  rel="noopener" title="微信支付崩溃了，但是更让马化腾和张小龙崩溃的竟然是……" data-report-click='{"mod":"popu_387","index":"31","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/loongggdroid\/article\/details\/102829823"}' data-report-view='{"mod":"popu_387","index":"31","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/loongggdroid\/article\/details\/102829823"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				微信支付崩溃了，但是更让马化腾和张小龙崩溃的竟然是……		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-30</span>
				<span class="read-num hover-hide">
					阅读数 
					1万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/loongggdroid/article/details/102829823" target="_blank" rel="noopener" title="微信支付崩溃了，但是更让马化腾和张小龙崩溃的竟然是……">
				<span class="desc oneline">loonggg读完需要3分钟速读仅需1分钟事件还得还原到昨天晚上，10月29日晚上20:09-21:14之间，微信支付发生故障，全国微信支付交易无法正常进行。然......</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/loongggdroid">来自：	<span class="blog_title"> 非著名程序员</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/Hello___Sunshine/article/details/103121035" target="_blank"  rel="noopener" title="五年程序员记流水账式的自白。" data-report-click='{"mod":"popu_387","index":"32","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Hello___Sunshine\/article\/details\/103121035"}' data-report-view='{"mod":"popu_387","index":"32","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Hello___Sunshine\/article\/details\/103121035"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				五年程序员记流水账式的自白。		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-18</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/Hello___Sunshine/article/details/103121035" target="_blank" rel="noopener" title="五年程序员记流水账式的自白。">
				<span class="desc oneline">不知觉已中码龄已突破五年，一路走来从起初铁憨憨到现在的十九线程序员，一路成长，虽然不能成为高工，但是也能挡下一面，从15年很火的android开始入坑，走过java、.Net、QT，目前仍处于andr...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/Hello___Sunshine">来自：	<span class="blog_title"> Hello___Sunshine的专栏</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/Wood_Cube/article/details/90482105" target="_blank"  rel="noopener" title="python编程：从入门到实践习题第三章3-4~3-7" data-report-click='{"mod":"popu_387","index":"33","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Wood_Cube\/article\/details\/90482105"}' data-report-view='{"mod":"popu_387","index":"33","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Wood_Cube\/article\/details\/90482105"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				python编程：从入门到实践习题第三章3-4~3-7		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">05-23</span>
				<span class="read-num hover-hide">
					阅读数 
					210</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/Wood_Cube/article/details/90482105" target="_blank" rel="noopener" title="python编程：从入门到实践习题第三章3-4~3-7">
				<span class="desc oneline">3-4 嘉宾名单：如果你可以邀请任何人一起共进晚餐（无论是在世的还是故去的）， 你会邀请哪些人？请创建一个列表，其中包含至少 3个你想邀请的人；然后，使用这个 列表打印消息，邀请这些人来与你共进晚餐。...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/Wood_Cube">来自：	<span class="blog_title"> Wood_Cube的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/ZYDX18984003806/article/details/100103658" target="_blank"  rel="noopener" title="程序员求助：腾讯面试题，64匹马8个跑道，多少轮选出最快的四匹" data-report-click='{"mod":"popu_387","index":"34","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/ZYDX18984003806\/article\/details\/100103658"}' data-report-view='{"mod":"popu_387","index":"34","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/ZYDX18984003806\/article\/details\/100103658"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				程序员求助：腾讯面试题，64匹马8个跑道，多少轮选出最快的四匹		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">08-27</span>
				<span class="read-num hover-hide">
					阅读数 
					4万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/ZYDX18984003806/article/details/100103658" target="_blank" rel="noopener" title="程序员求助：腾讯面试题，64匹马8个跑道，多少轮选出最快的四匹">
				<span class="desc oneline">昨天，有网友私信我，说去阿里面试，彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static？他被难住了，因为他从来都没有考虑过这个问题。无独有偶，今天笔...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/ZYDX18984003806">来自：	<span class="blog_title"> web前端学习交流群：600610151</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/qq_40670946/article/details/102989709" target="_blank"  rel="noopener" title="spring源码阅读环境(几分钟下载包)" data-report-click='{"mod":"popu_387","index":"35","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_40670946\/article\/details\/102989709"}' data-report-view='{"mod":"popu_387","index":"35","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_40670946\/article\/details\/102989709"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				spring源码阅读环境(几分钟下载包)		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-09</span>
				<span class="read-num hover-hide">
					阅读数 
					2万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/qq_40670946/article/details/102989709" target="_blank" rel="noopener" title="spring源码阅读环境(几分钟下载包)">
				<span class="desc oneline">南南南南啊!简述：1.下载spring源码：2.安装gradle：3.构建源码：导入idea:简述：不能忍受慢(看到这里你就准备笑吧！！)其他大神的博客实在让我难受自己动手，下载spring，编译sp...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_40670946">来自：	<span class="blog_title"> qq_40670946的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/xufive/article/details/102856921" target="_blank"  rel="noopener" title="Python十大装B语法" data-report-click='{"mod":"popu_387","index":"36","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xufive\/article\/details\/102856921"}' data-report-view='{"mod":"popu_387","index":"36","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xufive\/article\/details\/102856921"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				Python十大装B语法		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-02</span>
				<span class="read-num hover-hide">
					阅读数 
					28万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/xufive/article/details/102856921" target="_blank" rel="noopener" title="Python十大装B语法">
				<span class="desc oneline">Python 是一种代表简单思想的语言，其语法相对简单，很容易上手。不过，如果就此小视 Python 语法的精妙和深邃，那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点，并...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/xufive">来自：	<span class="blog_title"> Python作业辅导员 - 天元浪子【许向武】</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/weixin_43943977/article/details/102691392" target="_blank"  rel="noopener" title="Python——画一棵漂亮的樱花树（不同种樱花+玫瑰+圣诞树喔）" data-report-click='{"mod":"popu_387","index":"37","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_43943977\/article\/details\/102691392"}' data-report-view='{"mod":"popu_387","index":"37","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_43943977\/article\/details\/102691392"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				Python——画一棵漂亮的樱花树（不同种樱花+玫瑰+圣诞树喔）		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">10-22</span>
				<span class="read-num hover-hide">
					阅读数 
					25万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/weixin_43943977/article/details/102691392" target="_blank" rel="noopener" title="Python——画一棵漂亮的樱花树（不同种樱花+玫瑰+圣诞树喔）">
				<span class="desc oneline">最近翻到一篇知乎，上面有不少用Python（大多是turtle库）绘制的树图，感觉很漂亮，我整理了一下，挑了一些我觉得不错的代码分享给大家（这些我都测试过，确实可以生成）one 樱花树 动态生成樱花效...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_43943977">来自：	<span class="blog_title"> 碎片</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/wjky2014/article/details/103083126" target="_blank"  rel="noopener" title="HAL 硬件抽象层介绍" data-report-click='{"mod":"popu_387","index":"38","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/wjky2014\/article\/details\/103083126"}' data-report-view='{"mod":"popu_387","index":"38","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/wjky2014\/article\/details\/103083126"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				HAL 硬件抽象层介绍		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">11-15</span>
				<span class="read-num hover-hide">
					阅读数 
					4567</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/wjky2014/article/details/103083126" target="_blank" rel="noopener" title="HAL 硬件抽象层介绍">
				<span class="desc oneline">和你一起终身学习，这里是程序员Android本篇文章主要介绍Android开发中的部分知识点，通过阅读本篇文章，您将收获以下内容:和你一起终身学习，这里是程序员 Android本篇文章主要介绍Andr...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/wjky2014">来自：	<span class="blog_title"> 程序员Android</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/xili2532/article/details/96570505" target="_blank"  rel="noopener" title="解读python3.7教程" data-report-click='{"mod":"popu_387","index":"39","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xili2532\/article\/details\/96570505"}' data-report-view='{"mod":"popu_387","index":"39","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xili2532\/article\/details\/96570505"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				解读python3.7教程		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">07-20</span>
				<span class="read-num hover-hide">
					阅读数 
					249</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/xili2532/article/details/96570505" target="_blank" rel="noopener" title="解读python3.7教程">
				<span class="desc oneline">一 . 变量 字符串的操作1.在交互式模式中，打印的表达式的结果赋给变量_， 在交互模式中 _ 代表一个待赋值的变量，打印的话是一个空的字符串，每当交互模式中有新的结果，则这个结果也就赋值给 ‘_’,...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/xili2532">来自：	<span class="blog_title"> Shallow的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
<div class="recommend-item-box type_blog clearfix">
	<div class="content">
		<a href="https://blog.csdn.net/PY0312/article/details/101087356" target="_blank"  rel="noopener" title="爬虫福利二 之 妹子图网MM批量下载" data-report-click='{"mod":"popu_387","index":"40","strategy":"BlogCommendHotData","dest":"https:\/\/blog.csdn.net\/PY0312\/article\/details\/101087356"}' data-report-view='{"mod":"popu_387","index":"40","strategy":"BlogCommendHotData","dest":"https:\/\/blog.csdn.net\/PY0312\/article\/details\/101087356"}' data-report-query='depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task' >
		<h4 class="text-truncate oneline">
				爬虫福利二 之 妹子图网MM批量下载		</h4>
		<div class="info-box d-flex align-content-center">
			<p class="date-and-readNum oneline">
				<span class="date hover-show">02-24</span>
				<span class="read-num hover-hide">
					阅读数 
					21万+</span>
				</p>
			</div>
		</a>
		<p class="content">
			<a href="https://blog.csdn.net/PY0312/article/details/101087356" target="_blank" rel="noopener" title="爬虫福利二 之 妹子图网MM批量下载">
				<span class="desc oneline">爬虫福利一：27报网MM批量下载  点击看了本文，相信大家对爬虫一定会产生强烈的兴趣，激励自己去学习爬虫，在这里提前祝：大家学有所成！目标网站：妹子图网环境：Python3.x相关第三方模块：requ...</span>
			</a>
			<span class="blog_title_box oneline ">
									<span class="type-show type-show-blog type-show-after">博文</span>
											<a target="_blank" rel="noopener" href="https://blog.csdn.net/PY0312">来自：	<span class="blog_title"> Nick.Peng 的博客</span></a>
												</span>
		</p>
	</div>
	</div>

	
	
                    <div class="recommend-item-box type_hot_word">
                    <div class="content clearfix">
                        <div class="float-left">
                                                                                <span>
                                <a href="https://blog.csdn.net/yilovexing/article/details/80577510" target="_blank">
                                python</a>
                            </span>
                                                        <span>
                                <a href="https://blog.csdn.net/slwbcsdn/article/details/53458352" target="_blank">
                                json</a>
                            </span>
                                                        <span>
                                <a href="https://blog.csdn.net/csdnnews/article/details/83753246" target="_blank">
                                java</a>
                            </span>
                                                        <span>
                                <a href="https://blog.csdn.net/qq_35077512/article/details/88952519" target="_blank">
                                mysql</a>
                            </span>
                                                        <span>
                                <a href="https://blog.csdn.net/pdcfighting/article/details/80297499" target="_blank">
                                pycharm</a>
                            </span>
                                                        <span>
                                <a href="https://blog.csdn.net/sinyu890807/article/details/97142065" target="_blank">
                                android</a>
                            </span>
                                                        <span>
                                <a href="https://blog.csdn.net/gexiaoyizhimei/article/details/100122368" target="_blank">
                                linux</a>
                            </span>
                                                        <span>
                                <a href="https://download.csdn.net/download/xhg_gszs/10978826" target="_blank">
                                json格式</a>
                            </span>
                                                    
                                                                                <span>
                                <a href="https://www.csdn.net/gather_16/MtTaIg2sNC1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                                c#影院售票系统有哪些</a>
                            </span>
                                                        <span>
                                <a href="https://www.csdn.net/gather_10/MtTaIg2sNS1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                                c#鼠标相对窗体的坐标</a>
                            </span>
                                                        <span>
                                <a href="https://www.csdn.net/gather_18/MtTaIg2sNi1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                                c# 如何快速的求和</a>
                            </span>
                                                        <span>
                                <a href="https://www.csdn.net/gather_1b/MtTaIg2sNy1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                                c# 界面设计</a>
                            </span>
                                                        <span>
                                <a href="https://www.csdn.net/gather_11/MtTaIg2sOC1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                                c#窗口隐藏</a>
                            </span>
                                                        <span>
                                <a href="https://www.csdn.net/gather_1e/MtTaIg2sOS1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                                c# 动态注入il</a>
                            </span>
                                                        <span>
                                <a href="https://www.csdn.net/gather_1c/MtTaIg3sMC1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                                测试c#程序的软件</a>
                            </span>
                                                        <span>
                                <a href="https://www.csdn.net/gather_1c/MtTaIg3sMS1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                                加入队列c#</a>
                            </span>
                                                        <span>
                                <a href="https://www.csdn.net/gather_1f/MtTaIg3sMy1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                                c# 模型验证取消</a>
                            </span>
                                                        <span>
                                <a href="https://www.csdn.net/gather_1e/MtTaIg3sNC1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                                c# 小数点后保留4位</a>
                            </span>
                                                                            </div>
                    </div>
                    </div>
                                    <div class="recommend-loading-box">
                    <img src='https://csdnimg.cn/release/phoenix/images/feedLoading.gif'>
                </div>
                <div class="recommend-end-box">
                    <p class="text-center">没有更多推荐了，<a href="https://blog.csdn.net/" class="c-blue c-blue-hover c-blue-focus">返回首页</a></p>
                </div>
            </div>
                            <div class="template-box">
                    <span>©️2019 CSDN</span><span class="point"></span>
                <span>皮肤主题: 大白</span>
                <span> 设计师:
                                            CSDN官方博客                                    </span>
                </div>
                    </main>
        <aside class="blog_container_aside">
	<!--主页引入-->

    <div id="asideProfile" class="aside-box">
    <!-- <h3 class="aside-title">个人资料</h3> -->
    <div class="profile-intro d-flex">
        <div class="avatar-box d-flex justify-content-center flex-column">
            <a href="https://blog.csdn.net/weixin_41084236"  data-report-click='{"mod":"popu_379","dest":"https://blog.csdn.net/weixin_41084236"}'>
                <img src="https://profile.csdnimg.cn/1/F/3/3_weixin_41084236" class="avatar_pic" username='weixin_41084236'>
                                    <img src="https://g.csdnimg.cn/static/user-reg-year/1x/2.png" class="user-years">
                            </a>
                    </div>
        <div class="user-info d-flex flex-column profile-intro-name-box">
            <div>
                                <span class="name csdn-tracking-statistics tracking-click "  style="display:block" data-report-click='{"mod":"popu_379","dest":"https://blog.csdn.net/weixin_41084236"}' username='weixin_41084236'>
                    <a href="https://blog.csdn.net/weixin_41084236" class="" id="uid" title='超级大黄狗Shawn'>
                    超级大黄狗Shawn                    </a>
                </span>
            </div>
            <div class="profile-intro-name-boxFooter">
                                                <span class="personal-home-page" style='right:-96px;'><a target="_blank" href="https://me.csdn.net/weixin_41084236">TA的个人主页 ></a></span>
                            </div>
        </div>
    </div>
    <div class="data-info d-flex item-tiling">
                <dl class="text-center" title="33">
                            <dt><a href="https://blog.csdn.net/weixin_41084236" data-report-query="t=1">原创</a></dt>
                <dd><a href="https://blog.csdn.net/weixin_41084236" data-report-query="t=1"><span class="count">33</span></a></dd>
                    </dl>
        <dl class="text-center" id="fanBox" title="570">
            <dt>粉丝</dt>
            <dd><span class="count" id="fan">570</span></dd>
        </dl>
        <dl class="text-center" title="335">
            <dt>获赞</dt>
            <dd><span class="count">335</span></dd>
        </dl>
        <dl class="text-center" title="53">
            <dt>评论</dt>
            <dd><span class="count">53</span></dd>
        </dl>
        <dl class="text-center" title="186751">
            <dt>访问</dt>
            <dd><span class="count">18万+</span></dd>
        </dl>
    </div>
    <div class="grade-box clearfix">
        <dl class="aside-box-footerClassify">
            <dt>等级:</dt>
            <dd>
                <a href="https://blog.csdn.net/home/help.html#level" title="4级,点击查看等级说明" target="_blank">
                    <svg class="icon icon-level" aria-hidden="true">
                        <use xlink:href="#csdnc-bloglevel-4"></use>
                    </svg>
                </a>
            </dd>
        </dl>
        <dl title="55441">
            <dt>周排名:</dt>
            <dd>
                <a class="grade-box-rankA" href="https://blog.csdn.net/rank/writing_rank" target="_blank">
                    5万+                </a>
            </dd>
        </dl>
        <dl>
            <dt>积分:</dt>
            <dd title="1377">
                1377            </dd>
        </dl>
        <dl title="45222">
            <dt>总排名:</dt>
            <dd>
                <a class="grade-box-rankA" href="https://blog.csdn.net/rank/writing_rank_total" target="_blank">
                    4万+                </a>
            </dd>
        </dl>
    </div>
    <div class="aside-box-footer">
                    <div class="badge-box d-flex">
                <div class="profile-medal">勋章:</div>
                <div class="badge d-flex">
                                                                                                        <div class="icon-badge" title="持之以恒">
                                    <div class="mouse-box">
                                        <img src="https://csdnimg.cn/medal/chizhiyiheng@120.png" alt="">
                                        <div class="icon-arrow"></div>
                                    </div>
                                    <div class="grade-detail-box">
                                        <div class="pos-box">
                                            <div class="left-box d-flex justify-content-center align-items-center flex-column">
                                                <img src="https://csdnimg.cn/medal/chizhiyiheng@120.png" alt="">
                                                <p>持之以恒</p>
                                            </div>
                                            <div class="right-box">
                                                授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里，不积小流无以成江海，程序人生的精彩需要坚持不懈地积累！                                            </div>
                                        </div>
                                    </div>
                                </div>
                                                                                        </div>
                <script>
                    (function($) {
                        setTimeout(function() {
                            $('div.icon-badge.show-moment').removeClass('show-moment');
                        }, 5000);
                    })(window.jQuery)
                </script>
            </div>
                
    </div>
        <div class="profile-intro-name-boxOpration">
        <div class="opt-letter-watch-box">
                            <a class="personal-watch bt-button" id="btnAttent" data-report-click='{"mod":"popu_379"}'>关注</a>
                    </div>
        <div class='opt-letter-watch-box'>
            <a class="bt-button btn-red-hollow personal-letter" href=https://im.csdn.net/im/main.html?userName=weixin_41084236 target="_blank" rel="noopener">私信</a>
        </div>
    </div>
    </div>
<script>
    function watchBtnChange(flag, username) {
        $('span.blog-expert-button-follow').each(function(index) {
            if (flag) {
                if ($(this).attr("data-name") == username) {
                    $(this).html('<span class="hover-hide">已关注</span><span class="hover-show">取消</span>').removeClass('btn-red-follow').addClass('btn-gray-follow attented');
                }
            } else {
                if ($(this).attr("data-name") == username) {
                    $(this).html("关注").addClass('btn-red-follow').removeClass('btn-gray-follow attented');
                }
            }
        })
        if (username == $('p.csdn-tracking-statistics').attr("username")) {
            if (flag) {
                $('#btnAttent').addClass("attented").text("已关注").removeClass('btn-red-hollow').addClass('btn-gray-hollow');
                changeFans(1)
            } else {
                $('#btnAttent').text("关注").addClass('btn-red-hollow').removeClass('btn-gray-hollow attented');
                changeFans(-1)
            }
        }

    }

    function changeFans(num) {
        if ($('#fan').text().indexOf('+') < 0) {
            $('#fan').text(parseInt($('#fan').text()) + num);
        } else {
            $('#fanBox').attr('title', parseInt($('#fanBox').attr('title')) + num);
        }
    }
    window.csdn = window.csdn ? window.csdn : {};
    window.csdn.watchBtnChange = watchBtnChange;
</script><div class="csdn-tracking-statistics mb8 box-shadow" data-pid="blog" data-report-click='{"mod":"popu_4"}' data-report-view='{"mod":"popu_4"}' style="height:250px;">
    <div class="aside-content text-center" id="cpro_u2734133">
        <div id="kp_box_56" data-pid="56"><script  data-ad-client="ca-pub-1076724771190722" async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 博客内页左上视窗-20181120 -->
<ins class="adsbygoogle"
     style="display:inline-block;width:300px;height:250px"
     data-ad-client="ca-pub-1076724771190722"
     data-ad-slot="7700527946"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=56&a=703&c=0&k=&d=1&t=3&u=079978816677425fba926417f6936197"></div>    </div>
</div>
<div id="asideNewArticle" class="aside-box">
    <h3 class="aside-title">最新文章</h3>
    <div class="aside-content">
        <ul class="inf_list clearfix">
                        <li class="clearfix">
                <a data-report-click='{"mod":"popu_382","dest":"https://blog.csdn.net/weixin_41084236/article/details/84578756"}' href="https://blog.csdn.net/weixin_41084236/article/details/84578756" target="_blank" >
                                        工资条: Main部分部分                </a>
            </li>
                        <li class="clearfix">
                <a data-report-click='{"mod":"popu_382","dest":"https://blog.csdn.net/weixin_41084236/article/details/84562273"}' href="https://blog.csdn.net/weixin_41084236/article/details/84562273" target="_blank" >
                                        工资条: EmailSender部分                </a>
            </li>
                        <li class="clearfix">
                <a data-report-click='{"mod":"popu_382","dest":"https://blog.csdn.net/weixin_41084236/article/details/84539281"}' href="https://blog.csdn.net/weixin_41084236/article/details/84539281" target="_blank" >
                                        工资条: OneEmailInfo部分                </a>
            </li>
                        <li class="clearfix">
                <a data-report-click='{"mod":"popu_382","dest":"https://blog.csdn.net/weixin_41084236/article/details/84375236"}' href="https://blog.csdn.net/weixin_41084236/article/details/84375236" target="_blank" >
                                        工资条: ReadXLSX部分                </a>
            </li>
                        <li class="clearfix">
                <a data-report-click='{"mod":"popu_382","dest":"https://blog.csdn.net/weixin_41084236/article/details/84336293"}' href="https://blog.csdn.net/weixin_41084236/article/details/84336293" target="_blank" >
                                        工资条: TableMaker部分                </a>
            </li>
                    </ul>
    </div>
</div>
    <div id="asideCategory" class="aside-box"
         style="display:block!important;">
    <h3 class="aside-title">分类专栏</h3>
    <div class="aside-content">
        <ul>
                            <li class="">
                                        <a class="clearfix" 
                                                    data-report-click='{"mod":"popu_537","strategy":"","dest":"https://blog.csdn.net/weixin_41084236/category_7821299.html"}'
                            data-report-view='{"mod":"popu_537","strategy":"","dest":"https://blog.csdn.net/weixin_41084236/category_7821299.html"}'
                                               href="https://blog.csdn.net/weixin_41084236/category_7821299.html">
                                                    <img src="https://img-blog.csdnimg.cn/2019091813595558.png" alt="">
                                                <!--####是否付费-->
                        <span class="title oneline"><span class="text">LeetCode</span>
                                                    </span>
                        <!--####是否付费-->
                                                    <span class="count float-right">7篇</span>
                                            </a>
                </li>
                            <li class="">
                                        <a class="clearfix" 
                                                    data-report-click='{"mod":"popu_537","strategy":"","dest":"https://blog.csdn.net/weixin_41084236/category_8231181.html"}'
                            data-report-view='{"mod":"popu_537","strategy":"","dest":"https://blog.csdn.net/weixin_41084236/category_8231181.html"}'
                                               href="https://blog.csdn.net/weixin_41084236/category_8231181.html">
                                                    <img src="https://img-blog.csdnimg.cn/20190918140158853.png" alt="">
                                                <!--####是否付费-->
                        <span class="title oneline"><span class="text">bodymovin</span>
                                                    </span>
                        <!--####是否付费-->
                                                    <span class="count float-right">1篇</span>
                                            </a>
                </li>
                            <li class="">
                                        <a class="clearfix" 
                                                    data-report-click='{"mod":"popu_537","strategy":"","dest":"https://blog.csdn.net/weixin_41084236/category_8251358.html"}'
                            data-report-view='{"mod":"popu_537","strategy":"","dest":"https://blog.csdn.net/weixin_41084236/category_8251358.html"}'
                                               href="https://blog.csdn.net/weixin_41084236/category_8251358.html">
                                                    <img src="https://img-blog.csdnimg.cn/20190927151124774.png" alt="">
                                                <!--####是否付费-->
                        <span class="title oneline"><span class="text">Kotlin</span>
                                                    </span>
                        <!--####是否付费-->
                                                    <span class="count float-right">1篇</span>
                                            </a>
                </li>
                            <li class="">
                                        <a class="clearfix" 
                                                    data-report-click='{"mod":"popu_537","strategy":"","dest":"https://blog.csdn.net/weixin_41084236/category_8260295.html"}'
                            data-report-view='{"mod":"popu_537","strategy":"","dest":"https://blog.csdn.net/weixin_41084236/category_8260295.html"}'
                                               href="https://blog.csdn.net/weixin_41084236/category_8260295.html">
                                                    <img src="https://img-blog.csdnimg.cn/20190927151132530.png" alt="">
                                                <!--####是否付费-->
                        <span class="title oneline"><span class="text">Android</span>
                                                    </span>
                        <!--####是否付费-->
                                                    <span class="count float-right">1篇</span>
                                            </a>
                </li>
                    </ul>
    </div>
    </div>
<div id="asideArchive" class="aside-box">
    <h3 class="aside-title">归档</h3>
    <div class="aside-content">
        <ul class="archive-list">
                        <!--归档统计-->
            <li>
                <a href="https://blog.csdn.net/weixin_41084236/article/month/2018/11" data-report-click='{"mod":"popu_538","dest":"https://blog.csdn.net/weixin_41084236/article/month/2018/11"}'>
                    2018年11月                    <span class="count float-right">6篇</span>
                </a>
            </li>
                        <!--归档统计-->
            <li>
                <a href="https://blog.csdn.net/weixin_41084236/article/month/2018/10" data-report-click='{"mod":"popu_538","dest":"https://blog.csdn.net/weixin_41084236/article/month/2018/10"}'>
                    2018年10月                    <span class="count float-right">4篇</span>
                </a>
            </li>
                        <!--归档统计-->
            <li>
                <a href="https://blog.csdn.net/weixin_41084236/article/month/2018/09" data-report-click='{"mod":"popu_538","dest":"https://blog.csdn.net/weixin_41084236/article/month/2018/09"}'>
                    2018年9月                    <span class="count float-right">4篇</span>
                </a>
            </li>
                        <!--归档统计-->
            <li>
                <a href="https://blog.csdn.net/weixin_41084236/article/month/2018/08" data-report-click='{"mod":"popu_538","dest":"https://blog.csdn.net/weixin_41084236/article/month/2018/08"}'>
                    2018年8月                    <span class="count float-right">13篇</span>
                </a>
            </li>
                        <!--归档统计-->
            <li>
                <a href="https://blog.csdn.net/weixin_41084236/article/month/2018/07" data-report-click='{"mod":"popu_538","dest":"https://blog.csdn.net/weixin_41084236/article/month/2018/07"}'>
                    2018年7月                    <span class="count float-right">6篇</span>
                </a>
            </li>
                    </ul>
    </div>
    </div>
<div id="asideHotArticle" class="aside-box">
	<h3 class="aside-title">热门文章</h3>
	<div class="aside-content">
		<ul class="hotArticle-list">
							<li>

                    <a
                    data-report-click='{"mod":"popu_541","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963"}' 
                     href="https://blog.csdn.net/weixin_41084236/article/details/81564963" >
                                                快速入门（完整）：Python实例100个（基于最新Python3.7版本）                    </a>
					<p class="read">阅读数 <span>121342</span></p>
				</li>
							<li>

                    <a
                    data-report-click='{"mod":"popu_541","dest":"https://blog.csdn.net/weixin_41084236/article/details/82769925"}' 
                     href="https://blog.csdn.net/weixin_41084236/article/details/82769925" >
                                                Python中的与或非以及逻辑短路                    </a>
					<p class="read">阅读数 <span>14624</span></p>
				</li>
							<li>

                    <a
                    data-report-click='{"mod":"popu_541","dest":"https://blog.csdn.net/weixin_41084236/article/details/82218431"}' 
                     href="https://blog.csdn.net/weixin_41084236/article/details/82218431" >
                                                海龟绘图:Python3.7的turtle模块                    </a>
					<p class="read">阅读数 <span>10515</span></p>
				</li>
							<li>

                    <a
                    data-report-click='{"mod":"popu_541","dest":"https://blog.csdn.net/weixin_41084236/article/details/81457949"}' 
                     href="https://blog.csdn.net/weixin_41084236/article/details/81457949" >
                                                随机数：Python3.7的random模块详解                    </a>
					<p class="read">阅读数 <span>5656</span></p>
				</li>
							<li>

                    <a
                    data-report-click='{"mod":"popu_541","dest":"https://blog.csdn.net/weixin_41084236/article/details/83107237"}' 
                     href="https://blog.csdn.net/weixin_41084236/article/details/83107237" >
                                                用python快速制作xml文件                    </a>
					<p class="read">阅读数 <span>3655</span></p>
				</li>
					</ul>
	</div>
</div>
<div id="asideNewComments" class="aside-box">
    <h3 class="aside-title">最新评论</h3>
    <div class="aside-content">
        <ul class="newcomment-list">
                        <li>
                <a class="title text-truncate" data-report-click='{"mod":"popu_542","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963#comments"}'  target="_blank" href="https://blog.csdn.net/weixin_41084236/article/details/81564963#comments">快速入门（完整）：Python实例...</a>
                <p class="comment ellipsis">
                    <a href="https://my.csdn.net/caspershi" class="user-name" target="_blank">caspershi：</a>还不错，不过当中还是有点bug，那个算阶乘的 25,26  两个输出的是不一样的。 同样用20！ 测试 fact: 2432902008176640000
loop: 2561327494111820313                </p>
            </li>
                        <li>
                <a class="title text-truncate" data-report-click='{"mod":"popu_542","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963#comments"}'  target="_blank" href="https://blog.csdn.net/weixin_41084236/article/details/81564963#comments">快速入门（完整）：Python实例...</a>
                <p class="comment ellipsis">
                    <a href="https://my.csdn.net/herryuan" class="user-name" target="_blank">herryuan：</a>厉害，其中第三个：
[code=python]
for i in range(1,30):
    if (((i*i + 168)**0.5)*1000) % 1000 == 0:
        result = i*i - 100
        break
print(&#039;The integer could be {0}.&#039;.format(result))
[/code]
结果也可以是： - 99
-99 + 100 = 1 = 1 * 1
1 + 168 = 169 = 13 *13                </p>
            </li>
                        <li>
                <a class="title text-truncate" data-report-click='{"mod":"popu_542","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963#comments"}'  target="_blank" href="https://blog.csdn.net/weixin_41084236/article/details/81564963#comments">快速入门（完整）：Python实例...</a>
                <p class="comment ellipsis">
                    <a href="https://my.csdn.net/reurn_return_null" class="user-name" target="_blank">reurn_return_null：</a>顶                </p>
            </li>
                        <li>
                <a class="title text-truncate" data-report-click='{"mod":"popu_542","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963#comments"}'  target="_blank" href="https://blog.csdn.net/weixin_41084236/article/details/81564963#comments">快速入门（完整）：Python实例...</a>
                <p class="comment ellipsis">
                    <a href="https://my.csdn.net/zhangkongcs" class="user-name" target="_blank">zhangkongcs：</a>厉害厉害                </p>
            </li>
                        <li>
                <a class="title text-truncate" data-report-click='{"mod":"popu_542","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963#comments"}'  target="_blank" href="https://blog.csdn.net/weixin_41084236/article/details/81564963#comments">快速入门（完整）：Python实例...</a>
                <p class="comment ellipsis">
                    <a href="https://my.csdn.net/Gin_l" class="user-name" target="_blank">Gin_l：</a>你也太厉害了                </p>
            </li>
                    </ul>
    </div>
</div>
	<div id="asideFooter">
                    <div class="aside-box">
                <div id="kp_box_57" data-pid="57"><script type="text/javascript">
    (function() {
        var s = "_" + Math.random().toString(36).slice(2);
        document.write('<div style="" id="' + s + '"></div>');
        (window.slotbydup = window.slotbydup || []).push({
            id: "u3163270",
            container:  s
        });
    })();
</script>
<!-- 多条广告如下脚本只需引入一次 -->
<script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/c.js" async="async" defer="defer" ></script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=57&a=77&c=0&k=&d=1&t=3&u=07fdf17971554596a8f1bb522f592fc5"></div>            </div>
        		<div class="aside-box">
			<div class="persion_article">
			</div>
		</div>
	</div>
</aside>
<script src="https://csdnimg.cn/pubfooter/js/publib_footer-1.0.3.js" data-isfootertrack="false" type="text/javascript"></script>
<script>
	$("a.flexible-btn").click(function(){
		$(this).parents('div.aside-box').removeClass('flexible-box');
		$(this).parents("p.text-center").remove();
	})
</script>
<script src="https://g.csdnimg.cn/user-tooltip/1.9/user-tooltip.js"  type="text/javascript"></script>
    </div>
                        <div class="recommend-right  align-items-stretch clearfix" data-type="recommend">
            <aside class="recommend-right_aside">
                <div id="recommend-right" style="height:100%;">
                    <div class="recommend-top-adbox d-flex flex-column aside-box">
                                            <div id="kp_box_479" data-pid="479"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 博客内页右上视窗 -->
<ins class="adsbygoogle"
     style="display:inline-block;width:300px;height:250px"
     data-ad-client="ca-pub-1076724771190722"
     data-ad-slot="9261210258"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=479&a=874&c=0&k=&d=1&t=3&u=da16c04ceeff41f8a97e170f26dc6267"></div>                                        </div>
                    <div class="recommend-list-box d-flex flex-column aside-box">
                    <ul class="recommend-fixed-box align-items-stretch">
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/dajiangtai007/article/details/65632987"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"1","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/dajiangtai007\/article\/details\/65632987"}'                                     data-report-view='{"mod":"popu_858","index":"1","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/dajiangtai007\/article\/details\/65632987"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                【Python精华】100个Python练手小程序                                            </h5>
                                                                                            <span class="time">03-24</span>
                                                                                                                                        <span class="read"> 阅读数 13万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/Ch97CKd/article/details/80823328"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"2","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Ch97CKd\/article\/details\/80823328"}'                                     data-report-view='{"mod":"popu_858","index":"2","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Ch97CKd\/article\/details\/80823328"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                18个Python爬虫实战案例（已开源）                                            </h5>
                                                                                            <span class="time">06-26</span>
                                                                                                                                        <span class="read"> 阅读数 2万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_41597912/article/details/79710972"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"3","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_41597912\/article\/details\/79710972"}'                                     data-report-view='{"mod":"popu_858","index":"3","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_41597912\/article\/details\/79710972"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                十个Python练手的实战项目，学会这些Python就基本没问题了                                            </h5>
                                                                                            <span class="time">03-27</span>
                                                                                                                                        <span class="read"> 阅读数 10万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_42712463/article/details/86065521"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"4","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42712463\/article\/details\/86065521"}'                                     data-report-view='{"mod":"popu_858","index":"4","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42712463\/article\/details\/86065521"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                分享7个python案例，python真的无所不能且容易上手（带源码）                                            </h5>
                                                                                            <span class="time">01-08</span>
                                                                                                                                        <span class="read"> 阅读数 5729 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/weixin_44941957/article/details/89739681"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"5","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_44941957\/article\/details\/89739681"}'                                     data-report-view='{"mod":"popu_858","index":"5","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_44941957\/article\/details\/89739681"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                最新Python教程全套合集项目实战(完整)                                            </h5>
                                                                                            <span class="time">05-01</span>
                                                                                                                                        <span class="read"> 阅读数 4901 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/I_love_you_dandan/article/details/102901472"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"6","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/I_love_you_dandan\/article\/details\/102901472"}'                                     data-report-view='{"mod":"popu_858","index":"6","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/I_love_you_dandan\/article\/details\/102901472"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                Python实例大全（基于Python3.7.4）                                            </h5>
                                                                                            <span class="time">11-04</span>
                                                                                                                                        <span class="read"> 阅读数 4万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_42271991/article/details/81535703"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"7","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42271991\/article\/details\/81535703"}'                                     data-report-view='{"mod":"popu_858","index":"7","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42271991\/article\/details\/81535703"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                100个python进阶实战小项目（适合新手） 微信撤回查看|抖音批量下载等                                            </h5>
                                                                                            <span class="time">08-09</span>
                                                                                                                                        <span class="read"> 阅读数 1336 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_35527032/article/details/81023121"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"8","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35527032\/article\/details\/81023121"}'                                     data-report-view='{"mod":"popu_858","index":"8","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35527032\/article\/details\/81023121"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                几个好玩有趣的Python入门实例                                            </h5>
                                                                                            <span class="time">07-12</span>
                                                                                                                                        <span class="read"> 阅读数 1万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/A_Ainley/article/details/104168299"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"9","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/A_Ainley\/article\/details\/104168299"}'                                     data-report-view='{"mod":"popu_858","index":"9","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/A_Ainley\/article\/details\/104168299"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                快速入门（完整）：Python实例100个（基于最新Python3.7版本）+ 源代码                                            </h5>
                                                                                            <span class="time">02-04</span>
                                                                                                                                        <span class="read"> 阅读数 424 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_35190492/article/details/103105780"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"10","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35190492\/article\/details\/103105780"}'                                     data-report-view='{"mod":"popu_858","index":"10","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35190492\/article\/details\/103105780"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                阿里面试官问我：如何设计秒杀系统？我的回答让他比起大拇指                                            </h5>
                                                                                            <span class="time">11-18</span>
                                                                                                                                        <span class="read"> 阅读数 6万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/valada/article/details/79982704"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"11","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/valada\/article\/details\/79982704"}'                                     data-report-view='{"mod":"popu_858","index":"11","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/valada\/article\/details\/79982704"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                Python 快速入门实战教程                                            </h5>
                                                                                            <span class="time">04-17</span>
                                                                                                                                        <span class="read"> 阅读数 1万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_38161040/article/details/87295245"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"12","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_38161040\/article\/details\/87295245"}'                                     data-report-view='{"mod":"popu_858","index":"12","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_38161040\/article\/details\/87295245"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                Python 入门篇-最新版python3.7.2的安装。                                            </h5>
                                                                                            <span class="time">04-12</span>
                                                                                                                                        <span class="read"> 阅读数 7284 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/fei347795790/article/details/102838861"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"13","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/fei347795790\/article\/details\/102838861"}'                                     data-report-view='{"mod":"popu_858","index":"13","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/fei347795790\/article\/details\/102838861"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                超实用的 30 段 Python 案例（一）                                            </h5>
                                                                                            <span class="time">10-31</span>
                                                                                                                                        <span class="read"> 阅读数 1680 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_35190492/article/details/103153444"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"14","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35190492\/article\/details\/103153444"}'                                     data-report-view='{"mod":"popu_858","index":"14","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_35190492\/article\/details\/103153444"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                面试官问我：什么是消息队列？什么场景需要他？用了会出现什么问题？                                            </h5>
                                                                                            <span class="time">11-20</span>
                                                                                                                                        <span class="read"> 阅读数 6万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_42554007/article/details/102802719"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"15","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42554007\/article\/details\/102802719"}'                                     data-report-view='{"mod":"popu_858","index":"15","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_42554007\/article\/details\/102802719"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                python学习方法总结(内附python全套学习资料)                                            </h5>
                                                                                            <span class="time">11-03</span>
                                                                                                                                        <span class="read"> 阅读数 5万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/puran1218/article/details/104563081"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"16","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/puran1218\/article\/details\/104563081"}'                                     data-report-view='{"mod":"popu_858","index":"16","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/puran1218\/article\/details\/104563081"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                02 神经网络 - 神经网络和深度学习 [Deep Learning Specialization系列]                                            </h5>
                                                                                            <span class="time">02-28</span>
                                                                                                                                        <span class="read"> 阅读数 389 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/weixin_34055910/article/details/90334401"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"17","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_34055910\/article\/details\/90334401"}'                                     data-report-view='{"mod":"popu_858","index":"17","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_34055910\/article\/details\/90334401"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                几个小例子告诉你, 一行Python代码能干哪些事                                            </h5>
                                                                                            <span class="time">10-31</span>
                                                                                                                                        <span class="read"> 阅读数 66 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/xie_0723/article/details/79775539"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"18","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xie_0723\/article\/details\/79775539"}'                                     data-report-view='{"mod":"popu_858","index":"18","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xie_0723\/article\/details\/79775539"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                Atom Python 配置Python3 解释器                                            </h5>
                                                                                            <span class="time">04-01</span>
                                                                                                                                        <span class="read"> 阅读数 5628 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_16855077/article/details/104569388"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"19","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_16855077\/article\/details\/104569388"}'                                     data-report-view='{"mod":"popu_858","index":"19","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_16855077\/article\/details\/104569388"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                【多线程并发编程】十一 生产者和消费者问题(面试必问)                                            </h5>
                                                                                            <span class="time">02-29</span>
                                                                                                                                        <span class="read"> 阅读数 402 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/YKenan/article/details/88135978"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"20","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/YKenan\/article\/details\/88135978"}'                                     data-report-view='{"mod":"popu_858","index":"20","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/YKenan\/article\/details\/88135978"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                Windows 安装 Python3.7                                            </h5>
                                                                                            <span class="time">03-04</span>
                                                                                                                                        <span class="read"> 阅读数 1503 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/Mu_Xiaoye/article/details/104559874"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"21","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Mu_Xiaoye\/article\/details\/104559874"}'                                     data-report-view='{"mod":"popu_858","index":"21","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Mu_Xiaoye\/article\/details\/104559874"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                北京大学肖臻老师《区块链技术与应用》公开课笔记21——ETH挖矿算法篇1                                            </h5>
                                                                                            <span class="time">03-01</span>
                                                                                                                                        <span class="read"> 阅读数 660 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/u011738045/article/details/84024670"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"22","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/u011738045\/article\/details\/84024670"}'                                     data-report-view='{"mod":"popu_858","index":"22","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/u011738045\/article\/details\/84024670"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                python3.7 最新面试题大全(总结)--1                                            </h5>
                                                                                            <span class="time">11-13</span>
                                                                                                                                        <span class="read"> 阅读数 537 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/bowei026/article/details/90112056"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"23","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/bowei026\/article\/details\/90112056"}'                                     data-report-view='{"mod":"popu_858","index":"23","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/bowei026\/article\/details\/90112056"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                python3.7入门系列十 类和对象                                            </h5>
                                                                                            <span class="time">05-11</span>
                                                                                                                                        <span class="read"> 阅读数 146 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/katyusha1/article/details/78380421"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"24","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/katyusha1\/article\/details\/78380421"}'                                     data-report-view='{"mod":"popu_858","index":"24","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/katyusha1\/article\/details\/78380421"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                python3爬虫攻略（7）：爬虫案例                                            </h5>
                                                                                            <span class="time">10-28</span>
                                                                                                                                        <span class="read"> 阅读数 654 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/java_sha/article/details/100895297"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"25","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/java_sha\/article\/details\/100895297"}'                                     data-report-view='{"mod":"popu_858","index":"25","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/java_sha\/article\/details\/100895297"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                从入门到精通，Java学习路线导航（附学习资源）                                            </h5>
                                                                                            <span class="time">09-16</span>
                                                                                                                                        <span class="read"> 阅读数 10万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_40630246/article/details/102643196"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"26","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_40630246\/article\/details\/102643196"}'                                     data-report-view='{"mod":"popu_858","index":"26","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_40630246\/article\/details\/102643196"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                c++制作的植物大战僵尸（开源项目）                                            </h5>
                                                                                            <span class="time">01-10</span>
                                                                                                                                        <span class="read"> 阅读数 4万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/jikexueyuan5555/article/details/77618537"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"27","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/jikexueyuan5555\/article\/details\/77618537"}'                                     data-report-view='{"mod":"popu_858","index":"27","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/jikexueyuan5555\/article\/details\/77618537"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                python几个应用实例                                            </h5>
                                                                                            <span class="time">08-27</span>
                                                                                                                                        <span class="read"> 阅读数 4863 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/Neuf_Soleil/article/details/102788866"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"28","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Neuf_Soleil\/article\/details\/102788866"}'                                     data-report-view='{"mod":"popu_858","index":"28","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Neuf_Soleil\/article\/details\/102788866"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                Vue + Spring Boot 项目实战（十四）：用户认证方案与完善的访问拦截                                            </h5>
                                                                                            <span class="time">11-03</span>
                                                                                                                                        <span class="read"> 阅读数 3万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_41306364/article/details/103135904"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"29","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_41306364\/article\/details\/103135904"}'                                     data-report-view='{"mod":"popu_858","index":"29","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_41306364\/article\/details\/103135904"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                【管理系统课程设计】美少女手把手教你后台管理                                            </h5>
                                                                                            <span class="time">11-19</span>
                                                                                                                                        <span class="read"> 阅读数 1万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/hollis_chuang/article/details/103045322"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"30","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/hollis_chuang\/article\/details\/103045322"}'                                     data-report-view='{"mod":"popu_858","index":"30","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/hollis_chuang\/article\/details\/103045322"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                告别动态规划，连刷40道动规算法题，我总结了动规的套路                                            </h5>
                                                                                            <span class="time">11-13</span>
                                                                                                                                        <span class="read"> 阅读数 5512 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/loongggdroid/article/details/102829823"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"31","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/loongggdroid\/article\/details\/102829823"}'                                     data-report-view='{"mod":"popu_858","index":"31","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/loongggdroid\/article\/details\/102829823"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                微信支付崩溃了，但是更让马化腾和张小龙崩溃的竟然是……                                            </h5>
                                                                                            <span class="time">10-30</span>
                                                                                                                                        <span class="read"> 阅读数 1万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/Hello___Sunshine/article/details/103121035"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"32","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Hello___Sunshine\/article\/details\/103121035"}'                                     data-report-view='{"mod":"popu_858","index":"32","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Hello___Sunshine\/article\/details\/103121035"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                五年程序员记流水账式的自白。                                            </h5>
                                                                                            <span class="time">11-18</span>
                                                                                                                                        <span class="read"> 阅读数 2万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/Wood_Cube/article/details/90482105"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"33","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Wood_Cube\/article\/details\/90482105"}'                                     data-report-view='{"mod":"popu_858","index":"33","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/Wood_Cube\/article\/details\/90482105"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                python编程：从入门到实践习题第三章3-4~3-7                                            </h5>
                                                                                            <span class="time">05-23</span>
                                                                                                                                        <span class="read"> 阅读数 210 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/ZYDX18984003806/article/details/100103658"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"34","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/ZYDX18984003806\/article\/details\/100103658"}'                                     data-report-view='{"mod":"popu_858","index":"34","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/ZYDX18984003806\/article\/details\/100103658"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                程序员求助：腾讯面试题，64匹马8个跑道，多少轮选出最快的四匹                                            </h5>
                                                                                            <span class="time">08-27</span>
                                                                                                                                        <span class="read"> 阅读数 4万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/qq_40670946/article/details/102989709"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"35","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_40670946\/article\/details\/102989709"}'                                     data-report-view='{"mod":"popu_858","index":"35","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/qq_40670946\/article\/details\/102989709"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                spring源码阅读环境(几分钟下载包)                                            </h5>
                                                                                            <span class="time">11-09</span>
                                                                                                                                        <span class="read"> 阅读数 2万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/xufive/article/details/102856921"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"36","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xufive\/article\/details\/102856921"}'                                     data-report-view='{"mod":"popu_858","index":"36","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xufive\/article\/details\/102856921"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                Python十大装B语法                                            </h5>
                                                                                            <span class="time">11-02</span>
                                                                                                                                        <span class="read"> 阅读数 28万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/weixin_43943977/article/details/102691392"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"37","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_43943977\/article\/details\/102691392"}'                                     data-report-view='{"mod":"popu_858","index":"37","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/weixin_43943977\/article\/details\/102691392"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                Python——画一棵漂亮的樱花树（不同种樱花+玫瑰+圣诞树喔）                                            </h5>
                                                                                            <span class="time">10-22</span>
                                                                                                                                        <span class="read"> 阅读数 25万+ </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/wjky2014/article/details/103083126"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"38","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/wjky2014\/article\/details\/103083126"}'                                     data-report-view='{"mod":"popu_858","index":"38","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/wjky2014\/article\/details\/103083126"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                HAL 硬件抽象层介绍                                            </h5>
                                                                                            <span class="time">11-15</span>
                                                                                                                                        <span class="read"> 阅读数 4567 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                                    <li class="right-item">
                                <a
                                        href="https://blog.csdn.net/xili2532/article/details/96570505"
                                        target="_blank"
                                     data-report-click='{"mod":"popu_858","index":"39","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xili2532\/article\/details\/96570505"}'                                     data-report-view='{"mod":"popu_858","index":"39","strategy":"BlogCommendFromMachineLearnPai2","dest":"https:\/\/blog.csdn.net\/xili2532\/article\/details\/96570505"}'                                     data-report-query='depth_1-utm_source=distribute.pc_relevant_right.none-task&utm_source=distribute.pc_relevant_right.none-task'                                 >
                                    <div class="context-box ">
                                        <div class="content clearfix ">
                                            <h5>
                                                解读python3.7教程                                            </h5>
                                                                                            <span class="time">07-20</span>
                                                                                                                                        <span class="read"> 阅读数 249 </span>
                                                                                    </div>
                                                                            </div>
                                </a>
                            </li>
                                            </ul>
                    </div>
                </div>
            </aside>
        </div>
    
    </div>
<div class="mask-dark"></div>
<div class="tool-box vertical">
	<ul class="meau-list">
		<li class="btn-like-box long-width">
			<button class=" long-height hover-box btn-like " title="点赞">
				<svg class="icon active hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-thumbsup-ok"></use>
				</svg>
				<svg class="icon no-active hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-thumbsup"></use>
				</svg>
				<span class="hover-show text-box text">
					<span class="no-active">点赞</span>
					<span class="active">取消点赞</span>
				</span>
				<p id="supportCount">310</p>
			</button>
		</li>
		<li class="to-commentBox" id = 'sharePost' data-report-click='{"mod":"popu_794","dest":"https://blog.csdn.net/weixin_41084236/article/details/81564963"}'>
			<a class="btn-comments low-height hover-box" >
				<svg class="icon hover-hide" aria-hidden="true" style="padding-top: 3px;">
					<use xlink:href="#icon-csdnc-fenxiang"></use>
				</svg>
				<span class="hover-show text">海报</span>
				<p class="">
				</p>
			</a>
		</li>
		<li class="to-commentBox">
						<a class="btn-comments long-height hover-box" title="写评论" href="#commentBox">
				<svg class="icon hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-comments"></use>
				</svg>
				<span class="hover-show text">评论</span>
				<p class="">
						35				</p>
			</a>
		</li>
		<li class="toc-container-box" id="liTocBox">
			<a class="btn-toc low-height hover-box btn-comments" title="目录">
				<svg class="icon hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-contents"></use>
				</svg>
				<span class="hover-show text">目录</span>
			</a>
			<div class="toc-container">
				<div class="pos-box">
					<div class="icon-arrow"></div>
					<div class="scroll-box">
						<div class="toc-box"></div>
					</div>
				</div>
				<div class="opt-box">
					<button class="btn-opt prev nomore" title="向上">
						<svg class="icon" aria-hidden="true">
							<use xlink:href="#csdnc-chevronup"></use>
						</svg>
					</button>
					<button class="btn-opt next">
						<svg class="icon" aria-hidden="true">
							<use xlink:href="#csdnc-chevrondown"></use>
						</svg>
					</button>
				</div>
			</div>

		</li>
		<li>
			<a class="btn-bookmark low-height hover-box btn-comments"  data-report-click='{"mod":"popu_824"}' title="收藏">
				<svg class="icon active hover-hide" aria-hidden="true" style="padding-top: 2px;">
					<use xlink:href="#icon-shoucangjia"></use>
				</svg>
				<svg class="icon no-active hover-hide" aria-hidden="true" style="padding-top: 2px;">
					<use xlink:href="#icon-csdnc-Collection-G" ></use>
				</svg>
					<span class="hover-show text">收藏</span>
				<!-- <span class="hover-show text-box text">
					<span class="no-active">收藏</span>
					<span class="active">取消收藏</span>
				</span> -->
			</a>
		</li>
		<li class="bdsharebuttonbox">
			<div class="weixin-qr btn-comments low-height hover-box" >
				<a id="btnQrShare" class="bds_weixin clear-share-style" data-report-click='{"mod":"popu_831","dest":""}'  title="手机看"></a>
				<svg class="icon hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-usephone"></use>
				</svg>
				<span class="hover-show text text3">
					手机看
				</span>
			</div>
		</li>
							<li class="widescreen-hide">
				<a class="prev btn-comments low-height hover-box" href="https://blog.csdn.net/weixin_41084236/article/details/81509339" title="备胎模块：Python3.7的operator模块">
					<svg class="icon hover-hide" aria-hidden="true">
						<use xlink:href="#csdnc-chevronleft"></use>
					</svg>
					<span class="hover-show text text3">上一篇</span>
				</a>
			</li>
								<li class="widescreen-hide">
			<a class="next btn-comments hover-box low-height" href="https://blog.csdn.net/weixin_41084236/article/details/81626968" title="花式迭代器：Python3.7的itertools模块">
				<svg class="icon hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-chevronright"></use>
				</svg>
				<span class="hover-show text text3">下一篇</span>
			</a>
		</li>
						<!-- 宽屏更多按钮 -->
		<li class="widescreen-more">
			<a class="btn-comments chat-ask-button low-height hover-box" title="快问" href="#chatqa">
				<svg class="icon hover-hide" aria-hidden="true">
					<use xlink:href="#csdnc-more"></use>
				</svg>
				<span class="hover-show text">更多</span>

			</a>
			<ul class="widescreen-more-box">
													<li class="widescreen-more">
						<a class="btn-comments low-height hover-box" href="https://blog.csdn.net/weixin_41084236/article/details/81509339" title="备胎模块：Python3.7的operator模块">
							<svg class="icon hover-hide" aria-hidden="true">
								<use xlink:href="#csdnc-chevronleft"></use>
							</svg>
							<span class="hover-show text text3">上一篇</span>
						</a>
					</li>
																<li class="widescreen-more">
					<a class="btn-comments hover-box low-height" href="https://blog.csdn.net/weixin_41084236/article/details/81626968" title="花式迭代器：Python3.7的itertools模块">
						<svg class="icon hover-hide" aria-hidden="true">
							<use xlink:href="#csdnc-chevronright"></use>
						</svg>
						<span class="hover-show text text3">下一篇</span>
					</a>
				</li>
							</ul>
		</li>
        		<li class="to-commentBox to-reward">
			<a class="btn-comments low-height hover-box" data-report-click='{"mod":"popu_830" "dest":""}'  title="打赏">
				<svg class="hover-hide" width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
					<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
						<g transform="translate(-1398.000000, -486.000000)" fill-rule="nonzero">
							<g transform="translate(1398.000000, 486.000000)">
								<path d="M0,12 C0,16.287187 2.287187,20.2487113 6,22.3923048 C9.7128129,24.5358984 14.2871871,24.5358984 18,22.3923048 C21.712813,20.2487113 24,16.287187 24,12 C24,5.37258296 18.627417,0 12,0 C5.372583,0 0,5.37258296 0,12 Z" id="路径" fill-opacity="0.3" fill="#FF5A52"></path>
								<path d="M2.09340659,11.9505494 C2.09340659,15.4721673 3.97216734,18.7262766 7.02197798,20.4870856 C10.0717886,22.2478946 13.8293103,22.2478946 16.8791209,20.4870856 C19.9289316,18.7262766 21.8076923,15.4721673 21.8076923,11.9505494 C21.8076923,6.50659974 17.3944991,2.09340659 11.9505495,2.09340659 C6.50659977,2.09340659 2.09340659,6.50659974 2.09340659,11.9505494 Z" id="路径" fill="#F63D47"></path>
								<path d="M11.3005025,5.28638434 L12.7115578,5.28638434 L12.7115578,6.87854416 L14.1105528,6.87854416 C14.4,6.39607148 14.6592965,5.89550609 14.8884422,5.37081705 L16.1849246,5.82313519 C15.99799,6.23926787 15.7929648,6.58906055 15.5758794,6.88457507 L18,6.88457507 L18,9.84575109 L16.6733668,9.84575109 L16.6733668,8.03647857 L7.33869347,8.03647857 L7.33869347,9.85781291 L6,9.85781291 L6,6.87854416 L8.51457286,6.87854416 C8.31557789,6.52875147 8.08040201,6.1910206 7.80904523,5.86535155 L9.08140703,5.4009716 C9.39497488,5.80504246 9.67236181,6.29957695 9.92562814,6.88457507 L11.3065327,6.88457507 L11.3065327,5.28638434 L11.3005025,5.28638434 Z M12.8571429,13.9657994 C12.6552823,15.5675992 12.2332101,16.6234672 11.5848095,17.1394027 C10.8813559,17.8053195 9.1991844,18.2312662 6.54441188,18.4292415 L6,17.2233922 C8.22046642,17.1394027 9.68854339,16.8454395 10.3919969,16.3415024 C11.0098127,15.8735609 11.3768319,15.0456644 11.4930547,13.8578129 L12.8571429,13.9657994 Z M16.8571429,12.1435272 L16.8571429,15.9892245 L15.5161905,15.9892245 L15.5161905,13.3067319 L9.05523809,13.3067319 L9.05523809,16.1435272 L7.71428571,16.1435272 L7.71428571,12.1435272 L16.8571429,12.1435272 L16.8571429,12.1435272 Z M8.28571429,8.71495577 L15.7142857,8.71495577 L15.7142857,11.5720986 L8.28571429,11.5720986 L8.28571429,8.71495577 L8.28571429,8.71495577 Z M14.5714286,10.4292415 L14.5714286,9.28638434 L10,9.28638434 L10,10.4292415 L14.5714286,10.4292415 Z M12.9579832,16.1435272 C14.8187275,16.4853162 16.4993998,16.9018717 18,17.3931934 L17.2436975,18.4292415 C15.635054,17.8311106 13.9783914,17.3664911 12.2857143,17.0407235 L12.9579832,16.1435272 L12.9579832,16.1435272 Z" id="形状" fill="#FFFFFF"></path>
							</g>
						</g>
					</g>
				</svg>
				<span class="hover-show text">打赏</span>
			</a>
							<div id="reward" class="reward-box">
	<p class="rewad-title">打赏<span class="reward-close"><svg t="1567152543821" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10924" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12"><defs><style type="text/css"></style></defs><path d="M512 438.378667L806.506667 143.893333a52.032 52.032 0 1 1 73.6 73.621334L585.621333 512l294.485334 294.485333a52.074667 52.074667 0 0 1-73.6 73.642667L512 585.621333 217.514667 880.128a52.053333 52.053333 0 1 1-73.621334-73.642667L438.378667 512 143.893333 217.514667a52.053333 52.053333 0 1 1 73.621334-73.621334L512 438.378667z" fill="" p-id="10925"></path></svg></span></p>
	<dl>
		<dd><a href="javascript:;"><img src="https://profile.csdnimg.cn/1/F/3/3_weixin_41084236" alt=""></a></dd>
		<dt>
			<p class="blog-name">超级大黄狗Shawn</p>
			<p class="blog-discript">“你的鼓励将是我创作的最大动力”</p>
		</dt>
	</dl>
	<div class="money-box">
        			            	<span class="choosed choose_money" data-id="5">5C币</span>
			        							<span class="choose_money" data-id="10">10C币</span>
			        							<span class="choose_money" data-id="20">20C币</span>
			        							<span class="choose_money" data-id="50">50C币</span>
			        							<span class="choose_money" data-id="100">100C币</span>
			        							<span class="choose_money" data-id="200">200C币</span>
			        	</div>
	<div class="sure-box">
		<p class="is-have-money"><a class="reward-sure">确定</a></p>
	</div>
</div>

					</li>
        	</ul>
</div>
<div id = 'tool-post-common'>
	<div class = 'tool_post_box'>
		<img class = 'tool_post_img' src="https://csdnimg.cn/release/phoenix/write/assets/postShareBack.png" alt="">
		<div id = 'shareCode'></div>
	</div>
</div>
<div id="share-bg-shadow">
<div id="share-qrcode-box">
    <h3>分享到微信朋友圈</h3>
    <div class='qrcode-img-box'>
        <a class="btn-close">×</a>
        <div id='shareQrCode'></div>
	</div>
    <p>扫一扫，手机浏览</p>
</div>
</div>
<script>
		var imgReal = new Image();
		imgReal.src = "https://csdnimg.cn/release/phoenix/write/assets/postShareBack.png"
</script>
<script type=text/javascript crossorigin src="https://csdnimg.cn/release/phoenix/production/qrcode-7c90a92189.min.js"></script>
<script type=text/javascript crossorigin src="https://csdnimg.cn/release/phoenix/production/icon-1349369f06.js"></script>
<script src="//g.csdnimg.cn/??sharewx/1.2.1/sharewx.js" type="text/javascript"></script>
<script type="text/javascript" crossorigin src="https://g.csdnimg.cn/collection-box/1.1.7/collection-box.js"></script><script>
    var recommendCount = 40;
    recommendCount = recommendCount > 1 ? (recommendCount + (recommendCount>6 ? 2 : 1)) : recommendCount;
    var ChannelId = 16;
    var articleId = "81564963";
    var commentscount = 35;
    var islock = false;
    var curentUrl = "https://blog.csdn.net/weixin_41084236/article/details/81564963";
    var myUrl = "https://my.csdn.net/";
    //1禁止评论，2正常
    var commentAuth = 2;
    //百度搜索
    var baiduKey = "快速入门（完整）：Python实例100个（基于最新Python3.7版本）_Python_Shawn的博客-CSDN博客";
    var needInsertBaidu = true;
    // 代码段样式
    var codeStyle = 'atom-one-dark';
	var highlight = ["\u5feb\u901f","\u5165\u95e8","\u5b8c\u6574","Python","\u5b9e\u4f8b","\u6700\u65b0","Python","\u7248\u672c"];//高亮数组

    var share_card_url = 'https://blog.csdn.net/weixin_41084236/article/shareArticleCardPage?article_id=81564963'
    var RecommendBlogExpertList = [{"user_name":"dajiangtai007","nick_name":"\u5927\u6570\u636e\u7814\u4e60\u793e","avatar":"https:\/\/profile.csdnimg.cn\/3\/C\/7\/3_dajiangtai007","is_expert":false,"article_count":112,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"Ch97CKd","nick_name":"\u7a81\u56f4\u7684\u9c7c","avatar":"https:\/\/profile.csdnimg.cn\/5\/4\/9\/3_ch97ckd","is_expert":false,"article_count":531,"rank":"6000+"},{"user_name":"qq_41597912","nick_name":"\u71d5\u5927\u4fa0v","avatar":"https:\/\/profile.csdnimg.cn\/A\/C\/D\/3_qq_41597912","is_expert":false,"article_count":155,"rank":"7000+"},{"user_name":"qq_42712463","nick_name":"\u5c0f\u519c\u9a74","avatar":"https:\/\/profile.csdnimg.cn\/D\/E\/F\/3_qq_42712463","is_expert":false,"article_count":77,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"weixin_44941957","nick_name":"weixin_44941957","avatar":"https:\/\/profile.csdnimg.cn\/7\/4\/B\/3_weixin_44941957","is_expert":false,"article_count":5,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"I_love_you_dandan","nick_name":"MY\u00b7\u5f52\u96f6\u8005","avatar":"https:\/\/profile.csdnimg.cn\/2\/4\/0\/3_i_love_you_dandan","is_expert":false,"article_count":88,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"qq_42271991","nick_name":"qq_42271991","avatar":"https:\/\/profile.csdnimg.cn\/2\/8\/E\/3_qq_42271991","is_expert":false,"article_count":7,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"qq_35527032","nick_name":"\u50b2\u51b3\u6d41\u4e91","avatar":"https:\/\/profile.csdnimg.cn\/D\/E\/2\/3_qq_35527032","is_expert":false,"article_count":28,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"A_Ainley","nick_name":"Python\u5f00\u53d1\u8005_Ainley","avatar":"https:\/\/profile.csdnimg.cn\/2\/3\/5\/3_a_ainley","is_expert":false,"article_count":28,"rank":"\u5343\u91cc\u4e4b\u5916"},{"user_name":"qq_35190492","nick_name":"\u6556 \u4e19","avatar":"https:\/\/profile.csdnimg.cn\/8\/0\/6\/3_qq_35190492","is_expert":true,"article_count":50,"rank":"1000+"}];
	var articleType = 1;
	var CopyrightContent = '';
    </script>
<script src="https://csdnimg.cn/public/sandalstrap/1.4/js/sandalstrap.min.js"></script>
<script src="https://csdnimg.cn/release/phoenix/vendor/pagination/paging-3d3b805766.js"></script>
<div class="skin-boxshadow"></div>
<div style="display:none;">
	<img src="" onerror='setTimeout(function(){if(!/(csdn.net|iteye.com|baiducontent.com|googleusercontent.com|360webcache.com|sogoucdn.com|bingj.com|baidu.com)$/.test(window.location.hostname)){window.location.href="\x68\x74\x74\x70\x73\x3a\x2f\x2f\x77\x77\x77\x2e\x63\x73\x64\x6e\x2e\x6e\x65\x74"}},3000);'>
</div>
</body>
<script type="text/javascript" src="https://csdnimg.cn/release/phoenix/production/pc_wap_common-f91259fb12.js"></script>
<link rel="stylesheet" href="https://csdnimg.cn/release/blog_editor_html/release1.6.0/ckeditor/plugins/codesnippet/lib/highlight/styles/atom-one-dark.css">
<script>
 // 全局声明
 if (window.csdn === undefined) {
      window.csdn = {};
    }
    window.csdn.sideToolbar = {
        options: {
            report:{
                isShow: true,
            },
            qr: {
                isShow: false,
            }
        }
    }
    $(function(){
        $(document).on('click',"a.option-box[data-type='report']",function() {
            window.csdn.userLogin.loadAjax(function(res){
                showReport(false,articleTitles);
            })
        });
    })
</script>
<script src="https://csdnimg.cn/release/phoenix/vendor/iconfont/csdnc-c439e66521.js"></script>
<script src="https://csdnimg.cn/release/phoenix/template/js/common-da450fe83c.min.js"></script>
<script src="https://csdnimg.cn/release/phoenix/template/js/detail-aaf31e4d6c.min.js"></script>
	<script src="https://csdnimg.cn/release/phoenix/themes/skin3-template/skin3-template-e2b6be7b58.min.js"></script>
<script src="https://g.csdnimg.cn/copyright/1.0.3/copyright.js" type="text/javascript"></script>
<script type="text/javascript"  src="https://g.csdnimg.cn/??login-box/1.1.1/30/login-box.js,login-box/1.1.1/30/login-auto.js"></script>
<script>
    $(".MathJax").remove();
    if ($('div.markdown_views pre.prettyprint code.hljs').length > 0) {
        $('div.markdown_views')[0].className = 'markdown_views';
    }
</script>
<script type="text/javascript" src="https://csdnimg.cn/release/blog_mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
            "HTML-CSS": {
                    linebreaks: { automatic: true, width: "94%container" },
                    imageFont: null
            },
            tex2jax: {
                preview: "none"
            },
            mml2jax: {
                preview: 'none'
            }
    });
</script>
    <script src="//g.csdnimg.cn/baidu-search/1.0.2/baidu-search.js"  type="text/javascript"></script>
</html>
